Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Apr 2002
    Location
    Sydney, New South Wales, Australia
    Posts
    86
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating an e-mail with subject (Access97)

    I would like an e-mail to be generated when I click a button on a form. I would like
    the e-mail to have
    To: pdonnelly@dpk.com.au
    subect: Request for balance of order XXXX line YYYY

    where XXXX and YYYY are on the same form as the button

    Currently I have only the To: section working
    Private Sub ReqBal_click()
    Me.ReqBal.Hyperlink.Address = "mailtodonnelly@dpk.com.au"
    end sub

    how do I get the other fields filled?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Creating an e-mail with subject (Access97)

    I don't think you can do this with a hyperlink (if I'm wrong, others will jump in to correct me, no doubt).

    The easiest way is to use the SendObject method of the DoCmd object. Look it up in the online help.

    SendObject [ObjectType As AcSendObjectType = acSendNoObject], [ObjectName], [OutputFormat], [To], [Cc], [Bcc], [Subject], [MessageText], [EditMessage], [TemplateFile]

    If that isn't what you need, and if you use Outlook, you can use Automation to control Outlook from Access. See <post#=133130>post 133130</post#> and/or <post#=158114>post 158114</post#> for examples.

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating an e-mail with subject (Access97)

    Have a look at <post#=99464>post 99464</post#>.
    You can add lines in the openoutlook function to complete your mail like :
    myOLItem.Subject = .....
    myOLItem.Body = .....
    Even you can add
    myOLItem.Send
    to send the mail.

    If you are using Office 97 change Microsoft Outlook 9.0 Library Object to Microsoft Outlook 8.0 Library Object in the references.
    Francois

  4. #4
    Star Lounger
    Join Date
    Apr 2002
    Location
    Sydney, New South Wales, Australia
    Posts
    86
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating an e-mail with subject (Access97)

    Thank you Hans and Francois for you help. I've got it working now. <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>

    I am using the SendObject method but was able to learn a lot from Francois' method. Opening my eyes further to how much VB can do. I'm glad you are there to point the way.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •