Last modified: July 23, 2011

Applies to: Outlook

Retrieves a stream to be used for saving the current message.

HRESULT GetSaveStream(
ULONG FAR * pulFlags,
ULONG FAR * pulFormat,


[out] Pointer to a bitmask of flags that controls how the message text should be saved. The following flag can be set:


The message text is saved in Unicode format. If the MAPI_UNICODE flag is not set, the text is saved in ANSI format.


[out] Pointer to a bitmask of flags that controls the format of the saved text. The following flags can be set:


The message text is to be saved as formatted text in the Rich Text Format (RTF).


The message text is to be saved as plain text.


[out] Pointer to a pointer to the stream that will contain the saved message.


The stream was successfully retrieved.

Form objects call the IMAPIViewContext::GetSaveStream method to retrieve a stream an object that implements the IStream interface to support the handling of the Save As verb in the form viewer. The IMAPIForm::DoVerb method, which is implemented in the form server and called by the form viewer to invoke a verb, should not return until the message is fully converted into the appropriate text format and placed into the appropriate stream.

Do not write to the stream pointed to by ppstm before calling GetSaveStream. When GetSaveStream returns, do not reset the position of the seek pointer. This pointer must remain at the end of the saved message text.

© 2015 Microsoft