The CopyFolder method moves a subfolder. Copying a subfolder is not supported in Windows Mobile Messaging.
HRESULT CopyFolder ( ULONG cbEntryID, LPENTRYID lpEntryID, LPCIID lpInterface, LPVOID lpDestFolder, LPTSTR lpszNewFolderName, ULONG ulUIParam, LPMAPIPROGRESS lpProgress, ULONG ulFlags );
[in] Count of bytes in the entry identifier pointed to by lpEntryID.
[in] Reference to an ENTRYID structure that represents the entry identifier of the subfolder to move; cannot be NULL.
[in] Reference to the open folder to receive the moved subfolder.
[in] Must be NULL.
[in] Bitmask of flags that controls the move operation. The following flags can be set:
This flag is required. The subfolder is to be moved.
The name of the destination folder is in Unicode format.
This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:
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.
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.
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.