MsgConvertRtfInEmlMethod Property
Gets or sets if RTF text body from .MSG message should be added as an attachment or as a body part into the resulting .EML message, or not added at all.

Namespace: MailBee.Outlook
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public RtfInEmlStorageMethod RtfInEmlMethod { get; set; }

Property Value

Type: RtfInEmlStorageMethod
The default value is None which means that RTF part will not be added to the .EML message.
Remarks
If you set this property to AsAttachment, MailBee will add RTF (rich-text format) body of .MSG message as .RTF attachment named "richbody.rtf" to the resulting .EML message (into its Attachments collection). If you, however, need this body to be added to BodyParts collection where plain-text and HTML bodies usually reside, set this property value to AsBodyPart before making the conversion. This is useful if you need to get the contents of the RTF body as a string (for instance, if you assign its value to Rtf (System.Windows.Forms.RichTextBox.Rtf) property to display it in a RichTextBox control).
Note Note
This property makes sense only for ".MSG to .EML" direction of conversion. It's not used for ".EML to .MSG" conversions.
Examples
This sample displays RTF body of .MSG message in RichTextBox ((System.Windows.Forms.RichTextBox)) control of a WinForms application. It's assumed MailBee.Global.LicenseKey is already assigned (for instance, in app.config or web.config file) and the application form contains richTextBox1 control.
Note Note
If you prefer to open RTF with WordPAD (or with another program which opens .RTF files in your system) instead of feeding RTF data to the RichTextBox control, you should rather set RtfInEmlMethod property to AsAttachment, perform the conversion, then save "richbody.rtf" in Attachments collection of the resulting MailMessage into a file, and open that file in WordPAD.
// To use the code below, import these namespaces at the top of your code.
using MailBee.Outlook;
using MailBee.Mime;

// The actual code (put it into a method of your class).
MsgConvert conv = new MsgConvert();
conv.RtfInEmlMethod = RtfInEmlStorageMethod.AsBodyPart;
MailMessage msg = conv.MsgToMailMessage("test.msg");

if (msg.BodyParts["text/rtf"] != null)
{
    richTextBox1.Rtf = msg.BodyParts["text/rtf"].Text;
}
See Also