I understand that user can not move messages cross EAS account boundaries. Moving messages inside the same EAS account is perfectly fine when done manually from Outlook windows, but fails when done through automation objects. What's wrong here?
Outlook.MailItem item = Outlook.Namespace.GetItemFromID(MailItemEntryEid, MailItemStoreEid);
Outlook.MAPIFolder folder = Outlook.Namespace.GetFolderFromID(MAPIFolderEntryEid, MailItemStoreEid);
Outlook.MailItem newItem = item.Move(folder);
both item and folder objects constructed correctly, and belong to the same EAS store, however .Move on the last line is failing with this error:
(0x80040102): Sorry, Exchange ActiveSync doesn't support what you're trying to do.
If I do item.Delete() that moved the item to the Deleted Items folder
The "0x80004005" or "0x80040102" error message when you access a mailbox on an Exchange Server 2010 server by using a MAPI client article describes a similar issue. Do you work with public folders?
Anyway, you can use the Copy method instead and then Delete the source item.
Try to use MailItem.Copy followed by MailItem.Move before calling Save:
set Item = Application.ActiveExplorer.Selection(1)
set Target = Application.Session.GetDefaultFolder(olFolderDrafts)
set newItem = Item.Copy
set newItem = newItem.Move(Target)
User contributions licensed under CC BY-SA 3.0