Platform SDK: Exchange 2000 Server

TextBody Property

[This is preliminary documentation and subject to change.]

The plain text representation of the body of this message.

[Visual Basic]
Property TextBody as String
[C++]
HRESULT get_TextBody(BSTR* pVal);
HRESULT put_TextBody(BSTR Val);
IDL]
HRESULT [propget] TextBody([out,retval] BSTR* pVal);
HRESULT [propput] TextBody([in] BSTR Val);

Remarks

This property is also available as the urn:schemas:httpmail:textdescription entry in the schema.

To construct a MIME message containing both the plain text and HTML versions of the body, you can set the message's IBodyPart.ContentMediaType property to "multipart/alternative", the first body part's ContentMediaType to "text/plain", and the second body part's ContentMediaType to "text/richtext" or "text/html". Alternatively, you can use the IMessage.AutoGenerateTextBody and IMessage.MimeFormatted properties to automate some of this process. When these properties are both True and you set HTMLBody, CDO automatically sets the TextBody property to the plain text equivalent.

To access the corresponding HTML text string, use the IMessage.HTMLBody property. To retrieve the BodyPart object that contains the HTML part of the message, use the IMessage.HTMLBodyPart property.

The plain text is also available as a body part object through the IMessage.TextBodyPart method.

The TextBody property returns an empty string if it has never been set. If you need to determine whether this is the case or whether the plain text is present but currently an empty string, use the IMessage.TextBodyPart method to retrieve the BodyPart object containing the text portion of the message.

The default value of TextBody is an empty string.

See Also

urn:schemas:httpmail:textdescription, IMessage.TextBodyPart, IMessage.AutoGenerateTextBody