Hello
A Msg file has 2 body parts, Rtf and Html, no Text part, I load it to MapiMessage, SetBodyContent twice, first for its Html part, second for its Rtf part, and then save it, saved Msg will also have Text part, I didn’t set or modify the Text part, how to prevent it? Thanks.
You already declared that MapiMessage.SetBodyContent sets all properties, however, to set the Html part, no other method is provided as .BodyHtml is read-only!
If I only use .SetBodyRtf just once to update the Rtf part, Html part is also updated, seems that it’s generated from Rtf somehow, the problem: a Text part is also added to the target Msg!
Even using .BodyRtf only won’t help as it force make a Text part!
Thanks, because before this edit, there were no text part, so shouldn’t there be a Rtf body part SET method that only update Rtf part? And does not alter other parts, means if Text part exists, keep it, otherwise, don’t add it.
Thanks for the tip, how to remove PidTagBody?
Finally, I load the MapiMessage.BodyRtf into Aspose Words Document, set a color for Document:
Document.PageColor = Color.Red
Then load the new Rtf back to MapiMessage.
Now, when I save MapiMessage the back color is not applied.
I saved and compared original MapiMessage.BodyRtf vs Words saved Rtf: Rtf.zip (125.7 KB)
Size is ~7 times bigger when saved using Words and very different, which Rtf version is used for Outlook Rtf?