Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Feb 2002
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Email message from Access (Access 2000)

    My form has a lable which contains an email hyperlink address. When I click on the label, the default email program will open with the address and subject, and the user needs to add in whatever message before sending. The code for the hyperlinked label is as follows:

    Private Sub lblEmail_Click()
    lblEmail.HyperlinkAddress = "mailto:<an email address>?subject=<an email subjecy>
    End Sub

    It works fine so far. Now I also want to add a pre-determined short message into the body of the email where the hyperlink is clicked.

    Can I do that in Access?

    PS: Perhaps the alternative is sending the message as an attachment. How can it be done?

  2. #2
    2 Star Lounger
    Join Date
    Feb 2002
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Email message from Access (Access 2000)

    I found the solution after searching the internet. I changed my label into a command button, and add in the code

    DoCmd.SendObject acSendNoObject, , , strEmailAddr, , , strSubject, strMsgBody, True

    The boolean parameter True is to enable user to edit the email message. Take note of the parameters which are left blank. The solution may be helpful for anyone who may have the same problem as me.

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

    Re: Email message from Access (Access 2000)

    You already found a different method. It is also possible to use the HyperlinkAddress:

    lblEmail.HyperlinkAddress = "mailto:<an email address>?subject=<an email subjecy>&body=<some text>"

  4. #4
    2 Star Lounger
    Join Date
    Feb 2002
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Email message from Access (Access 2000)

    Using HyperlinkAddress is simpler but it has one caveat : the message text is in a single paragraph only; whereas by using docmd.SendObject, I can add vbCr in my message text to break it into several paragraphs.

Posting Permissions

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