PC Review


Reply
Thread Tools Rate Thread

How to determine the format of a mailitem (Plain Text, RTF, HTML etc)

 
 
Alan
Guest
Posts: n/a
 
      1st Aug 2005

Hi All,

I would like to be able to test a mailitem and return the format type
being one of the following:

Plain Text
Rich Text
HTML

I thought that would be quite easy, but I can't seem to work out how
to do it.

Apologies in advance if I am just being dim and it is staring me in
the face!

Thanks,

Alan.



 
Reply With Quote
 
 
 
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      1st Aug 2005
Use the MailItem.BodyFormat property.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Alan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> Hi All,
>
> I would like to be able to test a mailitem and return the format type
> being one of the following:
>
> Plain Text
> Rich Text
> HTML
>
> I thought that would be quite easy, but I can't seem to work out how
> to do it.
>
> Apologies in advance if I am just being dim and it is staring me in
> the face!
>
> Thanks,
>
> Alan.
>
>
>



 
Reply With Quote
 
Alan
Guest
Posts: n/a
 
      1st Aug 2005
"Dmitry Streblechenko" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
> Use the MailItem.BodyFormat property.
>


Hi Dmitry,

I cannot seem to see that property in my object browser.

I can see the following properties (amongst many others):

..Body
..HTMLBody

I had thought that (presumably) the .HTMLBody is empty unless the
format is HTML, but that does not allow for differentiating between
Plain Text and RTF (which I would definately like to be able to do)
and also I was not sure that .HTMLBody is non empty if and only if the
format is HTML.


I should have mentioned that I am using Outlook 2000 (SP3) - perhaps
it is a version issue?

If so, is there a workaround for OL2000?

Thanks,

Alan.





 
Reply With Quote
 
Dmitry Streblechenko
Guest
Posts: n/a
 
      1st Aug 2005
BodyFormat property was introduced in Outlook 2002. In the previous version
of Outlook you will need to read the RTF body (Extended MAPI or Redemption):
if it has "\fromhtml1" in the first 100 or so bytes, you have HTML, if you
have "\fromtext" - it is text, otherwise it is pure RTF.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Alan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Dmitry Streblechenko" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>>
>> Use the MailItem.BodyFormat property.
>>

>
> Hi Dmitry,
>
> I cannot seem to see that property in my object browser.
>
> I can see the following properties (amongst many others):
>
> .Body
> .HTMLBody
>
> I had thought that (presumably) the .HTMLBody is empty unless the
> format is HTML, but that does not allow for differentiating between
> Plain Text and RTF (which I would definately like to be able to do)
> and also I was not sure that .HTMLBody is non empty if and only if the
> format is HTML.
>
>
> I should have mentioned that I am using Outlook 2000 (SP3) - perhaps
> it is a version issue?
>
> If so, is there a workaround for OL2000?
>
> Thanks,
>
> Alan.
>
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change the format from plain text to HTML Suzyq Microsoft Outlook Discussion 1 29th Nov 2008 10:04 AM
forward html message in html format instead of plain text =?Utf-8?B?SmVyZW1pYWQ=?= Microsoft Outlook Discussion 3 8th Oct 2007 12:45 AM
forward html message in html format instead of plain text =?Utf-8?B?SmVyZW1pYWQ=?= Microsoft Outlook Discussion 0 5th Oct 2007 07:26 PM
Plain Text Vs HTML format =?Utf-8?B?TWF4d2VsbA==?= Microsoft Outlook Installation 2 26th Feb 2005 06:29 PM
Reply to HTML email using Plain Text format =?Utf-8?B?VG9tIE9zdHJhbmQ=?= Microsoft Outlook Discussion 1 23rd Jun 2004 10:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:47 PM.