IMAPIMessageSite::CopyMessage

Last modified: July 23, 2011

Applies to: Outlook

Copies the current message to a folder.

HRESULT CopyMessage(
  LPMAPIFOLDER pFolderDestination
);

pFolderDestination

[in] A pointer to the folder where the message is to be copied.

S_OK

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

MAPI_E_NO_SUPPORT

The operation is not supported by this message site.

Form objects call the IMAPIMessageSite::CopyMessage method to copy the current message to a new folder. CopyMessage does not change the message currently being displayed to the user, and no interface for the newly created message is returned to the form.

A typical implementation of the CopyMessage method performs the following tasks:

  1. Creates a new message for the current message to be copied to.

  2. Calls the IPersistMessage::Save method with a pointer to the new message in the pMessage parameter and FALSE in the fSameAsLoad parameter.

  3. Calls the IPersistMessage::SaveCompleted method, passing NULL in the pMessage parameter.

  4. Calls the IMAPIProp::SaveChanges method on the new message.

For a list of interfaces that are related to form servers, see MAPI Form Interfaces.

For MFCMAPI sample code, see the following table.

File

Function

Comment

MyMAPIFormViewer.cpp

CMyMAPIFormViewer::CopyMessage

Not implemented.

Show:
© 2015 Microsoft