Outlook 2013 Automation Objects: with hotmail EAS account. Move, Copy fails

0

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

c#
vba
outlook
outlook-addin
asked on Stack Overflow Feb 22, 2015 by Xavier John • edited Jun 26, 2020 by Martijn Pieters

2 Answers

0

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.

answered on Stack Overflow Feb 22, 2015 by Eugene Astafiev
0

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