Changing Mail Format with VBA

  • Thread starter Thread starter MWE
  • Start date Start date
M

MWE

I am running Outlook2000 and WinXP. I wish to write a
macro for Outlook that will enable me to change the mail
format (RTF vs plain vs HTML) more directly than
Tools/Options/Mail Format/etc. I find myself changing the
format a lot as I use various email accounts and send
messages to different users. I know a fair amount about
VBA, and how do do what I want EXCEPT I can not figure out
what variables and attributes control the format of
outgoing email.

Also, how do I determine the active Outlook account or
profile from VBA.

Thanks
 
It just so happens, that I'm working on a similar topic...

Here are some code snippets you can use to play with the
properties:

Find out type of currentitem:
debug.print Typename(ActiveInspector.CurrentItem)

Find out current body format for "MailItem":
debug.print ActiveInspector.CurrentItem.BodyFormat

Find out current editor type for "MailItem":
Select Case ActiveInspector.EditorType
Case olEditorHTML
debug.print "HTML"
Case olEditorRTF
debug.print "RTF"
Case olEditorWord
debug.print "WORD"
Case Else
debug.print "PLAIN TEXT"
End Select

What you can do is to create macros and put them on your
Inspector toolbar to change the BodyFormat property (If
you are not using Word as your email editor)

Code snippet (to change to HTML):
ActiveInspector.CurrentItem.BodyFormat = olFormatHTML
 
Back
Top