TextBody Property Home
Exchange Server 2003
TextBody Property

Topic Last Modified: 2004-06-08

TextBody Property

The TextBody property specifies the plain text representation of the message.

Syntax

Property TextBody as String
HRESULT get_TextBody(BSTR* pVal);
HRESULT put_TextBody(BSTR Val);
Remarks

This property is also available as the urn:schemas:httpmail:textdescription field.

To construct a Multipurpose Internet Mail Extensions (MIME) message that contains both the plain text and Hypertext Markup Language (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, Microsoft Collaboration Data Objects (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 is currently an empty string, use the IMessage.TextBodyPart method to retrieve the BodyPart object that contains the text portion of the message.

The default value of the TextBody property is an empty string.

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View