How to Hard Delete an Outlook Item

Add-in Express™ Support Service
That's what is more important than anything else

How to Hard Delete an Outlook Item
 
Scott English




Posts: 27
Joined: 2010-01-12
I want to "hard delete" an Outlook item, not just move it to the deleted items folder as the Outlook object model will do when you call the Delete method on an item. Can I do this with the MAPI Store Accessor? I didn't see any methods to accomplish this.
Posted 25 May, 2010 11:20:01 Top
Eugene Astafiev


Guest


Hi Scott,

You are right. There is no method in the MapiItem class. But you can find it in the MapiItems class (see the Remove method).
Posted 25 May, 2010 11:44:53 Top
Scott English




Posts: 27
Joined: 2010-01-12
Thanks, that works. Is there an easy way, given the MapiItem, to find it's associated MapiItems?
Posted 25 May, 2010 14:57:10 Top
Eugene Astafiev


Guest


Posted 28 May, 2010 10:45:46 Top
Scott English




Posts: 27
Joined: 2010-01-12
Maybe my question wasn't clear.

In the Outlook object model, items have a Parent property that can be used to find the containing folder. You can then get the folder's Items collection.

If I have an AddinExpress.MAPI.MapiItem, how do I find the MapiItems collection it is a part of? If I can find the containing AddinExpress.MAPI.Folder, I can use its MaipItems collection, but I can't see how to determine what folder the MapiItem is in. How do I do this?
Posted 28 May, 2010 11:41:08 Top
Eugene Astafiev


Guest


Hi Scott,

Thank you for clarifying this to me.

You can use the PR_PARENT_ENTRYID property to get the entry ID of the containing folder (see the GetProperty method of the AddinExpress.MAPI.MapiItem class). Then you can get the required folder using the GetFolderFromID function of the Namespace class in Outlook.
Posted 01 Jun, 2010 10:26:58 Top