HTMLBody and Body for MailItem

Add-in Express™ Support Service
That's what is more important than anything else

HTMLBody and Body for MailItem
 
Samir Gulrajani




Posts: 3
Joined: 2007-06-29
I am facing a problem getting HTML body for emails through the InspectorWindow. My requirement is to extract the Text part and HTML part of the same email.

mailItem.HTMLBody shoudl give me HTML formatted Mail, but returns empty string
mailItem.Body shoudl give me the Body Text, without HTML formatting, but it returns the HTMLBody

However, when I check the same properties in Outlook through VBA, it works perfectly, so most likely I am missing something that I am overlooking...

This is my VBA code:
Debug.Print Application.ActiveInspector.CurrentItem.Body
Debug.Print Application.ActiveInspector.CurrentItem.HTMLBody

In both the above tests, the same HTML message was used, which resides in my Drafts folder.

Just out of curiosity, In Outlook VBA, I see a property called "MailItem.BodyFormat" that returns the Body type = text/html/rtf.. Could not get property to show up in .NET?

Please help!
Posted 30 Jun, 2007 03:57:04 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Samir.

For some reason I can't reproduce the issue. I get the Body as well as HTMLBody without any problems in Outlook 2003. Are you sure that the email is created in HTML format?

Just out of curiosity, In Outlook VBA, I see a property called "MailItem.BodyFormat" that returns the Body type = text/html/rtf.. Could not get property to show up in .NET?

I suppose you use Outlook 2003. If so, you need to use PIAs for Outlook 2003.


P.S. We always do our best to answer your forum requests as soon as possible. However, we apply the rule "first in first out" with Premium Support Service subscribers taking priority. Please understand it may take us some time to do research on the issue. Please be assured we will let you know as soon as the best possible solution is found.
Posted 02 Jul, 2007 09:18:57 Top