Partager via


IPersistMessage::Save

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Saves a revised form back to the message from which it was loaded or created.

HRESULT Save(
  LPMESSAGE pMessage,
  ULONG fSameAsLoad
);

Parameters

  • pMessage
    [in] A pointer to the message.

  • fSameAsLoad
    [in] TRUE to indicate that the message pointed to by pMessage is the message from which the form was loaded or created; otherwise, FALSE.

Return Value

  • S_OK
    The form was successfully saved.

Remarks

Form viewers call the IPersistMessage::Save method to save a revised form back to the message from which it was loaded or created.

Save should only be called when the form is in its Normal state.

Notes to Implementers

Do not commit the saved changes; it is up to the caller to commit the changes. Never make changes to the properties that belong to the form's message except during the Save call.

If fSameAsLoad is set to TRUE, you can save the changes to the form's existing message. If fSameAsLoad is set to FALSE, you must copy all of the properties from the original message into the message pointed to by pMessage before performing the save. Use the original message's IMAPIProp::CopyTo method to copy the properties.

When all of the properties have been copied, enter the NoScribble state. If no errors occur, return S_OK. Otherwise, return the error from the failed action.

If Save is called when the form is in any state other than Normal, return E_UNEXPECTED.

For more information about saving storage objects, see the documentation on the IPersistStorage methods.

See Also

Reference

IPersistMessage : IUnknown

Concepts

Form States