ITnef::OpenTaggedBody

The ITnef::OpenTaggedBody method opens a stream interface on the text of an encapsulated message.

Quick Info

See ITnef : IUnknown.

HRESULT OpenTaggedBody(
  LPMESSAGE lpMessage,   
  ULONG ulFlags,         
  LPSTREAM FAR * lppStream  
);
 

Parameters

lpMessage
[in] Pointer to the message the stream is associated with. This message is not required to be the same message passed in the call to the OpenTnefStream or OpenTnefStreamEx function.
ulFlags
[in] Bitmask of flags that controls how the stream interface is opened. The following flags can be set:
MAPI_CREATE
If a property does not exist in the current message, it should be created. If the property does exist, the current data in the property should be replaced with the data from the TNEF stream. When an implementation sets the MAPI_CREATE flag, it should also set the MAPI_MODIFY flag.
MAPI_MODIFY
Requests read/write access. The default interface is read-only. MAPI_MODIFY must be set whenever MAPI_CREATE is set.
lppStream
[out] Pointer to the pointer to a stream object that contains the text from the PR_BODY property of the passed-in encapsulated message and that supports the IStream interface.

Return Values

S_OK
The call succeeded and has returned the expected value or values.

Remarks

Transport providers, message store providers, and gateways call the ITnef::OpenTaggedBody method to open a stream interface on the text of an encapsulated message — that is, on a TNEF object.

As part of its processing, OpenTaggedBody either inserts or parses attachment tags that indicate the position of any attachments or OLE objects within the message text. The attachment tags are in the following format:

[[ attachment name : n in attachment container name ]]

where attachment name describes the attachment object; n is a number identifying the attachment that is part of a sequence, incrementing from the value passed in the lpKey parameter of the OpenTnefStream or OpenTnefStreamEx function; and attachment container name describes the physical component where the attachment object resides.

OpenTaggedBody reads out message text and inserts an attachment tag wherever an attachment object originally appeared in the text. The original message text is not changed.

When a message that has tags is passed to a stream, the tags are stripped out and the attachment objects are relocated in the position of the tags in the stream.

See Also

OpenTnefStream, OpenTnefStreamEx, PR_BODY