Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    860
    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. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

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

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

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

  5. #4
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    10,273
    Thanks
    130
    Thanked 1,153 Times in 1,062 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
  •