Share via


IMimeMessageTree::GetBodyProp method

Gets the value of a property for a specified body.

Syntax

HRESULT GetBodyProp(
  [in]      HBODY         hBody,
  [in]      LPCSTR        pszName,
  [in]      DWORD         dwFlags,
  [in, out] LPPROPVARIANT pValue
);

Parameters

hBody [in]

Type: HBODY

Specifies the handle of the body. Use HBODY_ROOT (0xffffffff) to indicate the root body.

pszName [in]

Type: LPCSTR

Specifies the property name or ID.

dwFlags [in]

Type: DWORD

Specifies a bitmask that affects how to get the property value.

Value Meaning
PDF_ENCODED
0x00000001
Indicates that the value of the property is encoded in an Internet character set and possibly RFC 1522.
PDF_NAMEINDATA
0x00000002
Indicates that when getting the property value, the name of the property should be prefixed to the value.
PDF_HEADERFORMAT
0x00000004|PDF_ENCODED
Indicates that when getting the property value, the value should be in RFC 822 format.
PDF_NOCOMMENTS
0x00000008
Indicates that when getting the property value, any comments embedded in the value should be stripped out.
PDF_VECTOR
0x00000020
Indicates that when getting the value for a property that appears more than once, the values should be concatenated together (separated by carriage return line feeds).

pValue [in, out]

Type: LPPROPVARIANT

Receives the value associated with the property. The client must initialize the pValue->vt member to a VARTYPE that is supported for the corresponding property. The client is responsible for freeing this PROPVARIANT structure by calling PropVariantClear or by freeing pointers by calling IMalloc::Free.

Return value

Type: HRESULT

Returns one of the following values.

Return code Description
S_OK
Indicates success.
E_FAIL
Indicates that an unknown error has occurred.
E_INVALIDARG
Indicates that hBody, pszName, or pValue is NULL.
MIME_E_NO_DATA
Indicates that hBody is equal to HBODY_ROOT (0xffffffff) and there is no root body.
MIME_E_INVALID_HANDLE
Indicates that hBody is an invalid handle.
MIME_E_NOT_FOUND
Indicates that pszName does not specify an existing property.
MIME_E_VARTYPE_NO_CONVERT
Indicates that the VARTYPE cannot be converted to the requested type.

Remarks

A property ID can also be passed into this method through the pszName parameter using the PIDTOSTR macro.

MimeOLE supports these variant types: VT_LPSTR, VT_LPWSTR, VT_FILETIME, VT_UI4, VT_I4, and VT_STREAM.

This method is equivalent to:

pMessageTree->BindToObject(hBody, IID_IMimePropertySet, (LPVOID *)&pPropertySet);

pPropertySet->GetProp(pszName, dwFlags, pValue);

Requirements

Minimum supported client
Windows XP [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Product
Outlook Express 6.0
Header
Mimeole.h
IDL
Mimeole.idl
DLL
Inetcomm.dll (version 6.0 or later)