IMAPIFolder::CopyFolder

4/8/2010

The CopyFolder method moves a subfolder. Copying a subfolder is not supported in Windows Mobile Messaging.

Syntax

HRESULT CopyFolder (
  ULONG cbEntryID,
  LPENTRYID lpEntryID,
  LPCIID lpInterface,
  LPVOID lpDestFolder,
  LPTSTR lpszNewFolderName,
  ULONG ulUIParam,
  LPMAPIPROGRESS lpProgress,
  ULONG ulFlags
);

Parameters

  • cbEntryID
    [in] Count of bytes in the entry identifier pointed to by lpEntryID.
  • lpEntryID
    [in] Reference to an ENTRYID structure that represents the entry identifier of the subfolder to move; cannot be NULL.
  • lpInterface
    [in] Ignored.
  • lpDestFolder
    [in] Reference to the open folder to receive the moved subfolder.
  • lpszNewFolderName
    [in] Must be NULL.
  • ulUIParam
    [in] Ignored.
  • lpProgress
    [in] Ignored.
  • ulFlags
    [in] Bitmask of flags that controls the move operation. The following flags can be set:

    FOLDER_MOVE

    This flag is required. The subfolder is to be moved.

    MAPI_UNICODE

    The name of the destination folder is in Unicode format.

Return Value

This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:

  • S_OK
    Indicates success.
  • MAPI_E_COLLISION
    The name of the folder being moved is the same as that of a subfolder in the destination folder. The message store provider requires that folder names be unique.
  • MAPI_E_FOLDER_CYCLE
    The source folder directly or indirectly contains the destination folder. Significant work might have been performed before this condition was discovered, so the source and destination folder might be partially modified.

Remarks

The CopyFolder method moves a subfolder from one location to another. The subfolder being moved is added to the destination folder as a subfolder. Copying a subfolder is not supported in Windows Mobile Messaging.

When CopyFolder is unable to complete, do not assume that no work was done. CopyFolder might have been able to move one or more of the messages and subfolders before encountering the error.

Depending on the message store provider, the entry identifier of the original message may or may not be preserved in the copied message. MAPI recommends that entry identifiers be preserved whenever possible, but it is not a requirement. You can generally depend on the following:

  • When moving a folder between two different types of message stores, the entry identifier is guaranteed to change.
  • When moving a folder between two message stores of the same type, the entry identifier almost always changes.
  • When moving a folder to another location within the same message store, the entry identifier might or might not change, depending on the message store provider.

Requirements

Header mapidefs.h
Library cemapi.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Pocket PC 2002 and later, Smartphone 2002 and later

See Also

Reference

IMAPIFolder

Other Resources

Messaging