PDA

View Full Version : [SOLVED:] Setting format of an e-mail to HTML



oleander
10-16-2018, 08:28 AM
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!

gmayor
10-16-2018, 07:53 PM
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