Share via


IStoreNamespace::CopyMoveMessages method

Copies or moves messages from one message folder to another.

Syntax

HRESULT CopyMoveMessages(
  [in] IStoreFolder    *pSource,
  [in] IStoreFolder    *pDest,
  [in] LPMESSAGEIDLIST pMsgIdList,
  [in] DWORD           dwFlags,
  [in] DWORD           dwFlagsRemove,
  [in] IProgressNotify *pProgress
);

Parameters

pSource [in]

Type: IStoreFolder*

Pointer to an IStoreFolder interface that represents the source folder to move messages from.

pDest [in]

Type: IStoreFolder*

Pointer to an IStoreFolder interface that represents the destination folder to move messages to.

pMsgIdList [in]

Type: LPMESSAGEIDLIST

Pointer to a MESSAGEIDLIST structure that specifies the messages to be moved.

dwFlags [in]

Type: DWORD

Value that specifies how the messages are to be handled. Set to 0 to leave a copy of each message in the source folder. Set to 1 to delete the source messages after they are copied to the destination folder.

dwFlagsRemove [in]

Type: DWORD

A combination of state flags to clear from the list of messages specified by the pMsgIdList parameter. For a list of flags, see Message State Flags.

pProgress [in]

Type: IProgressNotify*

Pointer to an IProgressNotify interface that will receive notifications during the copy process.

Return value

Type: HRESULT

Returns S_OK if successful, or one of the following error values.

Return code Description
E_INVALIDARG
The value of pSource, pDest, or pMsgIdList is NULL.
MSOEAPI_E_STORE_INITIALIZE
The namespace has not been initialized. To initialize the namespace, call IStoreNamespace::Initialize.

Remarks

To add flags to a list of messages, call the SetFlags method.

Requirements

Minimum supported client
Windows XP [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Product
Outlook Express 6.0
Header
Msoeapi.h
IDL
Msoeapi.idl
DLL
Inetcomm.dll (version 6.0 or later)