Share via


IMAPIMessageSite::CopyMessage

Applies to: Office 2010 | Outlook 2010 | Visual Studio

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

Reference

IMAPIProp::SaveChanges

IPersistMessage::Save

IPersistMessage::SaveCompleted

IMAPIMessageSite : IUnknown

Concepts

MFCMAPI as a Code Sample

MAPI Form Interfaces