TextBodypart Property

TextBodypart Property

The TextBodypart property returns a reference to the BodyPart object that contains the plain text representation of the message.


Property TextBodypart as IBodyPart
HRESULT get_TextBodyPart(IBodyPart** pVal);


You can use the TextBodyPart property to quickly access the BodyPart object that contains the text portion of the message. That is, rather than enumerating the BodyPart hierarchy of the message that is seeking the object with its content type set to text/plain, you can use the TextBodyPart property to return a reference immediately. A similar mechanism is available for the text/html portion of the message using the IMessage.HTMLBody and IMessage.HTMLBodyPart properties.

The content of the BodyPart object referenced by the TextBodyPart property can be updated using the IMessage.TextBody property.

If the requested body part does not exist, the method returns an error.

See Also


TextBody Property
AutoGenerateTextBody Property
HTMLBody Property
HTMLBodyPart Property