Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    861
    Thanks
    0
    Thanked 10 Times in 9 Posts

    VBA / Outlook mail message

    We want a macro to add a prefix, "Privileged & Confidential" to the body of an Outlook mail message.

    Code:
    sText = "Privileged & Confidential" & vbcr & vbcr
    olkMsg.HTMLBody = sText & olkMsg.HTMLBody
    The above code adds the phrase before the message, but I can't get it to insert additional hard returns/line breaks to add space between sText and the HTMLBody. I've tried vbCR, vbCRLF, vbLF, Chr$(13).

    Is there something else I should be using?

    Thanks.

  2. #2
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    10,363
    Thanks
    130
    Thanked 1,163 Times in 1,070 Posts
    A line break in HTML is "<br/>", so your statement should look like this:

    Code:
    olkMsg.HTMLBody = sText & "<br/>" & olkMsg.HTMLBody
    Rui
    -------
    R4

  3. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    861
    Thanks
    0
    Thanked 10 Times in 9 Posts
    I understand. Thank you very much.

  4. #4
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    10,363
    Thanks
    130
    Thanked 1,163 Times in 1,070 Posts
    You're welcome.
    Rui
    -------
    R4

Posting Permissions

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