Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2010
    Location
    Yorkshire UK
    Posts
    76

    Unanswered: SendObject in html

    Hi,

    I am sending e-mails direct from Access from a command button

    DoCmd.SendObject , , acFormatHTML, , , , "Title", "Body Text"

    This works fine but the outputted text in the body of the e-mail is not in HTML format.

    What am I doing wrong here?

    Simon

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    What do you mean exactly? Are you expecting the text itself to be transformed in to html, or are you emitting html and you're expecting whatever you're using to send email to automatically recognize that it should tag the message as html?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Feb 2010
    Location
    Yorkshire UK
    Posts
    76
    When I click the command button, a line of text is sent as the body of an e-mail.

    strBody = "Thank you for your order number 1234 etc"

    When Outlook opens, I can not highlight and make BOLD or UNDERLINE any of this text until I change it to HTML format. I want the e-mail to open and allow me to UNDERLINE some of the body text.

    Simon

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    You don't have any html in strBody... I'm still not sure where exactly you want this formatting to happen.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Feb 2010
    Location
    Yorkshire UK
    Posts
    76
    When I am in OUTLOOK, I can type text into the e-mail. I can then highlight some of that text and click the B (bold) I (italic) or U (underline) icons and the highlighted text becomes BOLD, ITALICS or is UNDERLINED.

    When I send the text of the e-mail from ACCESS, when OUTLOOK opens up, the B, I or U icons are greyed out.

    To get the icons back and working, I have to click the combo box in OUTLOOK and change the text from PLAIN TEXT to HTML. I can then highlight the text and change whatever I want to BOLD etc.

    I want to miss out the stage of having to change the text in the mail from PLAIN TEXT to HTML.

    Does this make sense?

  6. #6
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    My gut feeling is that you can't specify HTML with SendObject, though I could be wrong. The HTML you've specified is for the output format of the attachment, not the body. I think you'll need to use automation:

    Using Automation to Send a Microsoft Outlook Message

    but instead of .Body you'd use .HTMLBody.
    Paul

Posting Permissions

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