Read the RTFBody property and check if "\fromhtml1" is in the first 100 bytes or so: if yes, you have HTML. If you have "\fromtext" - it is text. Otherwise it is pure RTF. If RTF is missing, check if PR_HTML_BODY or PR_HTML is present.
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool
"Vinayakc" <vinayakchitre[ at ]gmail.com> wrote in message news:1137142764.498151.51880[ at ]g49g2000cwa.googlegroups.com...
[Quoted Text] > Hi all, > > I have written one Outlook add-in in C++. I want to detect the mail > format of the mail through that add-in. ( RTF,HTML or Plain Text ). > I have tried to do some search on this, I only got that, thorugh VBA we > can use BodyFormat property of the mail item. How I can access this > property through my C++ code? > > If Outlook is able to detect the format of incoming mail, I think we > should also able to detect the format? Are there any MAPI properties > which we can use for this? > > Through OutllookSpy when I look the properties of that mail item, I > observerd that > 1. HTML and RTF mails have PR_RTF_COMPRESSED property. > 2. Plain text does not have PR_RTF_COMPRESSED property. > 3. RTF mails have useTNEF property value as True and HTML mails have > useTNEF property value as False. > > Will this observation help us?? > > Please reply as soon as possible. > > Thanks and Regards > Vinayakc >
|