Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ContentMediaType Property

Exchange Server 2003

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

Contains type and subtype identifiers that specify the nature of the data in a body part.

Applies To

Type Library

Microsoft CDO for Exchange 2000 Library

DLL Implemented In

CDOEX.DLL

Syntax

        [Visual Basic]Property ContentMediaType As String
        [C++]HRESULT get_ContentMediaType(BSTRpVal);
HRESULT put_ContentMediaType(BSTR Val);

Parameters

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

Remarks

The ContentMediaType property corresponds to the type and subtype of the Content-Type header field of 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 ContentMediaType is "<type>/<subtype>". Common types and subtypes include:

  • image/gif, image/jpeg
  • message/external-body, message/partial, message/rfc822
  • multipart/alternative, multipart/digest, multipart/mixed, multipart/related
  • text/html, text/plain

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 Graphics Interchange Format (GIF)
cdoJpeg "image/jpeg" Image encoded using Joint Photographic Experts Group format Industry Standards Organization (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 even a forward
cdoMultipartAlternative "multipart/alternative" Different versions of same content, simplest 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 URLs
cdoTextHtml "text/html" Text with HTML tags
cdoTextPlain "text/plain" Unstructured text

The contents of ContentMediaType are not case-sensitive. The default value is "text/plain".

Example

        [Visual Basic]
Dim iBp as CDO.BodyPart
    ' set a bodypart to oBp
iBp.ContentMediaType = "application/msword"
Show:
© 2015 Microsoft