IStoreFolder::OpenMessage method

Opens a specific message and retrieves a read-only stream that can be used to read the message body.

Syntax

HRESULT OpenMessage(
  [in]  MESSAGEID dwMessageId,
  [in]  REFIID    riid,
  [out] LPVOID    *ppvObject
);

Parameters

dwMessageId [in]

Type: MESSAGEID

Specifies the message to be opened.

riid [in]

Type: REFIID

Specifies the type of stream that ppvObject will receive. Must be either IID_IStream, or IID_IMimeMessage.

ppvObject [out]

Type: LPVOID*

Reference to a pointer that receives the stream.

Return value

Type: HRESULT

Returns S_OK if successful, or the following error value.

Return code Description
E_INVALIDARG
The value of the dwMessageId is invalid, the value of ppvObject is NULL, or the riid parameter is not IID_IStream or IID_IMimeMessage.

Remarks

This method will attempt to open the message body in a read-only mode. To obtain more information and properties about the message itself, call IStoreFolder::GetMessageProps.

The object that is received by ppvObject has memory associated with it, and must be freed by calling its IUnknown::Release method after use.

Requirements

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