Platform SDK: CDO for Windows 2000

ContentMediaType Property

The ContentMediaType property contains type and subtype identifiers that specify the nature of the data in a body part.

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

Remarks

The ContentMediaType property corresponds to the type and subtype of the Content-Type header field of Request for Comments (RFC) 2045.

This property corresponds to the urn:schemas:mailheader:content-type header field available in the Fields collection.

The format for the contents of the ContentMediaType property is <type>/<subtype>. Common types and subtypes include:

The following CdoContentTypeValues string constants are provided for use with the ContentMediaType property:

CdoContentTypeValues Module Constants

Constant Value Description
CdoGif image/gif Image encoded using Graphics Interchange Format (GIF)
cdoJpeg image/jpeg Image encoded using Joint Photographic Experts Group (JPEG) format (ISO/IEC 10918)
cdoMessageExternalBody message/external-body Pointer to message content outside this message
cdoMessagePartial message/partial One piece of a fragmented message
cdoMessageRFC822 message/rfc822 Simple e-mail message (not a forwarded message)
cdoMultipartAlternative multipart/alternative Different versions of same content, simplest version first
cdoMultipartDigest multipart/digest Different messages, including forwarded messages
cdoMultipartMixed multipart/mixed Body parts to be processed sequentially
cdoMultipartRelated multipart/related Body parts accessed through Uniform Resource Locators (URLs)
cdoTextHtml text/html Text with Hypertext Markup Language (HTML) tags
CdoTextPlain text/plain Unstructured text

The contents of ContentMediaType are case-insensitive. The default value is text/plain.

Example

Dim iBp as CDO.IBodyPart
    ' set a bodypart to oBp
iBp.ContentMediaType = "application/msword"