BodyFormat Property
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
OlBodyFormat
OlBodyFormat can be one of these OlBodyFormat constants. |
olFormatHTML |
olFormatPlain |
olFormatRichText |
olFormatUnspecified |
expression.BodyFormat
expression Required. An expression that returns one of the objects in the Applies To list.
Remarks
All text formatting will be lost when the BodyFormat property is switched from RTF to HTML and vice-versa.
The property can not be set to olFormatUnspecified, however it will return olFormatUnspecified if the item has not yet been displayed.
Example
The following example creates a new MailItem object and sets the BodyFormat property to olFormatRichText. The Body text of the Mail item will now appear in Rich Text format.
Sub NewMail()
'Creates a new Mailitem and modifies its properties
Dim olApp As Outlook.Application
Dim objMail As MailItem
Set olApp = Outlook.Application
'Create mail item
Set objMail = olApp.CreateItem(olMailItem)
With objMail
.DownloadState = olHeaderOnly
'Set body format to Rich Text
.BodyFormat = olFormatRichText
.Display
End With
End Sub