|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Copies or moves one or more messages.
If you are copying messages to another message store without using the IMAPISupport::CopyMessages method, you must first call IMAPIFolder::SetReadFlags with the GENERATE_RECEIPT_ONLY flag set. The receiving message store is not responsible for generating read reports for the copied or moved messages. If you are calling IMAPISupport::CopyMessages to implement IMAPIFolder::CopyMessages, do not call SetReadFlags; MAPI will call it.
Your implementation can move or copy the messages in any order and generate read status reports in any order. That is, you can finish copying messages before generating any of the read status reports or send the reports before your implementation starts the copy operation. However, read reports should be sent for all messages to be copied, regardless of whether the copy is successful.
When the copy or move operation involves more than one message, perform the operation as completely as possible. Do not stop the operation prematurely unless a failure occurs that is beyond your control, such as running out of memory, running out of disk space, or corruption in the message store.
Try to maintain entry identifiers across move or copy operations. You should also preserve entry identifiers, although it is not required.
Send notifications when you move or copy messages so that clients are forewarned that their calls to the messages' IMAPIProp::SaveChanges methods may fail.
Do not include a message's status in the copy or move operation. Moving or copying a message status greatly affects performance.
Use IMAPIFolder::CopyMessages to populate search-results folders, where messages are often grouped by parent folder.
Expect these return values under the following conditions.
IMAPIFolder::CopyMessages has successfully copied or moved every message.
IMAPIFolder::CopyMessages was unable to successfully copy or move every message.
IMAPIFolder::CopyMessages was unable to complete.
Any error value
When IMAPIFolder::CopyMessages is unable to complete, do not assume that no work was done. IMAPIFolder::CopyMessages might have been able to copy or move one or more messages before encountering the error.