PreferRtfBodyToHtml Logic

Hello
When loading a Msg/Oft/Tnef to MapiMessage or MailMessage and saving it as Eml, Mht or Html and all other formats, which body part will be used to be saved as the Html part of Eml/Mht files, or the body of Html documents?

The source Msg/Oft/Tnef might have both Rtf and Html parts inside, and I just found that there’s cases that instead of direct saving of Msg Html body part to target Eml/Html, it’s better to convert source Msg Rtf part to Html because of some known issues in Outlook internal Rtf to Html converter which is used to generate the Html part of Msg and other encoding related issues.

So is there any LoadOptions for loading Msg/Oft/Tnef files that specify when saving such messages as other formats, if it has both Html and Rtf body parts, which one to use to render the output?
If not, can be added to the feature request list?

Worth to see:

Thanks :slight_smile:

Can you please provide the results of such an option, and the source msg for an example?
Anyway, will be looking at this on Monday.
Thanks.

1 Like

Hi, thanks, here’s the sample project to see the difference between output html vs rtf body parts:

WindowsApplication6.zip (3.8 MB)

Details:
PreferRtfBodyToHtml Property
Gets or sets whether the HTML body of the resulting .EML should be taken from RTF part (instead of HTML part) of the source .MSG message, if it has both RTF and HTML part.
Sometimes, .MSG-to-.EML codepage transform will work better when HTML body is taken from RTF part. If .MSG contains only RTF part or only HTML part, RTF (or HTML, respectively) will be used regardless of the value of this property.

Very useful :slight_smile:

Ok, thanks for the additional info.