HRESULT NewMessage(
ULONG fComposeInFolder, LPMAPIFOLDER pFolderFocus, LPPERSISTMESSAGE pPersistMessage, LPMESSAGE FAR * ppMessage, LPMAPIMESSAGESITE FAR * ppMessageSite, LPMAPIVIEWCONTEXT FAR * ppViewContext );
Parameters
fComposeInFolder
[in] Variable indicating in which folder the message should be composed. If the variable is FALSE, the pFolderFocus parameter is ignored and the form viewer can compose the message in any folder. If the variable is TRUE and NULL is passed in pFolderFocus, the message is composed in the current folder. If the variable is TRUE and a non-null value is passed in pFolderFocus, the message is composed in the folder pointed to by pFolderFocus.
pFolderFocus
[in] Pointer to the folder where the new message is created.
pPersistMessage
[in] Pointer to the form object for the new form.
ppMessage
[out] Pointer to a pointer to the new message.
ppMessageSite
[out] Pointer to a pointer to a message site object for the new message.
ppViewContext
[out] Pointer to a pointer to a view context appropriate for passing to a new form with the new message. If the form implements its own view context, NULL can be passed in the ppViewContext parameter.
Return Values
S_OK
The call succeeded and has returned the expected value or values.
Remarks
Form objects call the IMAPIMessageSite::NewMessagemethod to create a new message. The form uses NewMessage to get a new message and the associated message site from its view. It can then modify the new message.
An associated view context can also be obtained by passing in a non-null value in the ppViewContext parameter. This view context can be used directly, or it can be aggregated and passed to the new message. If a complete implementation is required, NULL should be passed in ppViewContext.