问题
I am writing an application(C#) to sync contacts,appointments,tasks etc from one mailbox to other. I am able to retrieve changes to these items using SyncFolderItems but could not find a way to copy the changes to a different mailbox. It looks like I have to create a new item for each of these types on the destination mailbox. If that is the case how do I get all the properties on the source item onto the new item on the destination. I am currently using exchange 2007 sp1 environment and want to use the same code for exchange 2010 also.
回答1:
(This is what worked for me on Exchange 2010. The docs don't mention 2007 so you may be out of luck there.)
Use SyncFolderItems to find the items you want to move. Next, use ExportItems to export them to a file, and then UploadItems to put them into the other mailbox. ExportItems and UploadItems operations with Exchange Online is very detailed and has examples of the import/export operation (including an example where the source and destination are different mailboxes).
来源:https://stackoverflow.com/questions/13727009/ews-managed-api-how-to-copy-items-from-one-mailbox-to-other