Share via


IMAPISupport::CopyMessages

Applies to: Office 2010 | Outlook 2010 | Visual Studio

Copies or moves messages from one folder to another folder.

HRESULT CopyMessages(
  LPCIID lpSrcInterface,
  LPVOID lpSrcFolder,
  LPENTRYLIST lpMsgList,
  LPCIID lpDestInterface,
  LPVOID lpDestFolder,
  ULONG_PTR ulUIParam,
  LPMAPIPROGRESS lpProgress,
  ULONG ulFlags
);

Parameters

  • lpSrcInterface
    [in] A pointer to the interface identifier (IID) that represents the interface to be used to access the folder that contains the messages to be copied or moved.

  • lpSrcFolder
    [in] A pointer to the folder that contains the messages to be copied or moved.

  • lpMsgList
    [in] A pointer to an array of entry identifiers that identify the messages to be copied or moved.

  • lpDestInterface
    [in] A pointer to the interface identifier (IID) that represents the interface to be used to access the destination folder for the copied or moved messages.

  • lpDestFolder
    [in] A pointer to the destination folder for the copied or moved messages. This folder must be open.

  • ulUIParam
    [in] A pointer to a progress object that displays a progress indicator. If NULL is passed in lpProgress, the message store provider displays a progress indicator by using the MAPI progress object implementation. The lpProgress parameter is ignored unless the MESSAGE_DIALOG flag is set in ulFlags.

  • lpProgress
    [in] A pointer to a progress object that displays a progress indicator. If NULL is passed in lpProgress, the message store provider displays a progress indicator by using the MAPI progress object implementation. The lpProgress parameter is ignored unless the MESSAGE_DIALOG flag is set in ulFlags.

  • ulFlags
    [in] A bitmask of flags that controls how the copy or move operation is accomplished. The following flags can be set:

    • MESSAGE_DIALOG
      Requests the display of a progress indicator.

    • MESSAGE_MOVE
      The messages should be moved, instead of copied. If MESSAGE_MOVE is not set, the messages are copied.

Return Value

  • S_OK
    The copy or move operation was successful.

  • MAPI_E_USER_CANCEL
    The user canceled the operation, typically by clicking the Cancel button in a dialog box.

Remarks

The IMAPISupport::CopyMessages method is implemented for message store provider support objects. Message store providers can call IMAPISupport::CopyMessages in their implementation of IMAPIFolder::CopyMessages to copy or move one or more messages from one folder to another. As part of the IMAPISupport::CopyMessages call, the message store provider can specify that MAPI should display a progress indicator.

See Also

Reference

IMAPIFolder::CopyMessages

IMAPISupport : IUnknown