views:

215

answers:

0

I have tried many permutations of the same code, and always with the same result - the Outlook 2007 AddIn seems to be unable to remove the MailItem from the drafts folder - so a 'move' operation actually becomes a 'copy', and a 'delete' operation does nothing.

(Note: The AddIn was responsible for creating the item in the Drafts folder in the first place, and yes, I can delete it through the Outlook UI using Edit>Delete).

Heres an example of some of my code ('mi' is the MailItem in the drafts folder):

Microsoft.Office.Interop.Outlook.MAPIFolder deleted = 
  Globals.ThisAddIn.Application.Session.GetDefaultFolder
    (Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderDeletedItems);
Microsoft.Office.Interop.Outlook.MailItem movedItem = 
  mi.Move(deleted) as Microsoft.Office.Interop.Outlook.MailItem;

movedItem.Delete();

Any ideas why the drafts folder is behaving as 'read-only'?