次の方法で共有


IMimeMessageTree::SetBodyProp method

Sets the value of a property for a specified body.

Syntax

HRESULT SetBodyProp(
  [in] HBODY          hBody,
  [in] LPCSTR         pszName,
  [in] DWORD          dwFlags,
  [in] LPCPROPVARIANT 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 the property value is stored.

Value Meaning
PDF_ENCODED
0x00000001
Indicates that the value of the property is encoded in an Internet character set and possibly RFC 1522.
PDF_SAVENOENCODE
0x00000010
Indicates that when setting an address type header, the property value should not be re-encoded when the header is saved.

pValue [in]

Type: LPCPROPVARIANT

Specifies the value to set for the property.

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_OUTOFMEMORY
Indicates that an attempt to allocate memory failed.
E_INVALIDARG
Indicates that hBody, pszName, or pValue is NULL. Or, this value may indicate that pValue->vt specifies a VARTYPE that is unsupported or that its corresponding member in the PROPVARIANT structure is invalid; for example, a NULL pointer.
MIME_E_READ_ONLY
Indicates that the property is read-only, that is, the property has the MPF_READONLY flag set in the property schema.
MIME_E_INVALID_HEADER_NAME
Indicates that pszName is a new property that contains invalid characters.
MIME_E_NOT_FOUND
Indicates that pszName does not specify an existing property.
MIME_E_NO_DATA
Indicates that hBody is equal to HBODY_ROOT (0xffffffff) and there is no root body or that the property has no data.
MIME_E_INVALID_HANDLE
Indicates that hBody is an invalid handle.

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->SetProp(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)