Share via


ContentMediaType Property

Topic Last Modified: 2006-06-13

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

Applies To

IBodyPart Interface

Type Library

Microsoft CDO for Exchange 2000 Library

DLL Implemented In

CDOEX.DLL

Syntax

Property ContentMediaType As String
HRESULT get_ContentMediaType(BSTR* pVal);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

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