IMAPIMessageSite::CopyMessage

Applies to: Outlook 2013 | Outlook 2016

Copies the current message to a folder.

HRESULT CopyMessage(
  LPMAPIFOLDER pFolderDestination
);

Parameters

pFolderDestination

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

Return value

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.

Remarks

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.

Notes to implementers

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.

MFCMAPI reference

For MFCMAPI sample code, see the following table.

File Function Comment
MyMAPIFormViewer.cpp
CMyMAPIFormViewer::CopyMessage
Not implemented.

See also

IMAPIProp::SaveChanges

IPersistMessage::Save

IPersistMessage::SaveCompleted

IMAPIMessageSite : IUnknown

MFCMAPI as a Code Sample

MAPI Form Interfaces