HTMLBody Property

HTMLBody 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.

The HTML representation of the message.

Applies To

IMessage Interface

IWorkflowMessage Interface

Type Library

Microsoft CDO for Exchange 2000 Library

DLL Implemented In

CDOEX.DLL

Syntax

[Visual Basic]Property HTMLBody As String

[C++]HRESULT get_HTMLBody(BSTRpVal);
HRESULT put_HTMLBody(BSTR Val);

Parameters

  • pVal
    Returns the value of the HTMLBody property as a reference to a BSTR.
  • Val
    Sets the value of the HTMLBody property to the value of the BSTR.

Remarks

This property is also available as the htmldescription Field entry in the schema.

To construct a Multipurpose Internet Mail Extensions (MIME) message containing both the plain text and HTML versions of the body, you can set the message's ContentMediaType property on the IBodyPart interface 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 AutoGenerateTextBody and MimeFormatted properties to automate some of this process. When these properties are both True and you set HTMLBody, Collaboration Data Objects (CDO) automatically sets the TextBody property to the plain text equivalent.

If you set MimeFormatted to False, the HTMLBody property is removed from the message and the HTML text is lost.

To access the corresponding plain text string, use the TextBody property.

You can access the BodyPart object containing the HTML for the message using the IMessage.HTMLBodyPart property.

The HTMLBody property returns an empty string if it has never been set. If you need to determine whether this is the case or whether the HTML text is present but currently an empty string, use the IMessage.HTMLBodyPart method to access the BodyPart object containing the HTML for the message.

The default value of HTMLBody is an empty string.

See Also

htmldescription Field

HTMLBodyPart Property

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.