Consulting

Results 1 to 2 of 2

Thread: Setting format of an e-mail to HTML

  1. #1
    VBAX Newbie
    Joined
    Oct 2018
    Posts
    1
    Location

    Setting format of an e-mail to HTML

    Hi everyone,

    I'm trying to do something that I think is kind of basic, but I'm new to VBA so please bear with me.

    When I hit reply and the reply e-mail is still in the main Outlook pain, I want a button that will set the format of the e-mail to HTML. I have no clue if this is even remotely close or not, but it's not working:


    Sub FormatHTML()
    Dim myItem As Object
    Set myItem = Application.ActiveInspector.CurrentItem
    With myItem
        .BodyFormat = olFormatHTML
    End With
    End Sub

    If anyone could help out, I'd appreciate it! Thank you!
    Last edited by Aussiebear; 04-21-2023 at 06:52 PM. Reason: Added code tags

  2. #2
    Close

    Sub SetHTML()
    Dim olMsg As MailItem
        On Error Resume Next
        Set olMsg = ActiveExplorer.Selection.item(1)
        olMsg.Display
        olMsg.BodyFormat = olFormatHTML
        olMsg.Close olSave
    lbl_Exit:
        Set olMsg = Nothing
        Exit Sub
    End Sub
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

Posting Permissions

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