Trapping a deleted item from the explorer

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

Trapping a deleted item from the explorer
 
add-in-express.com.forum




Posts: 50
Joined: 2010-10-17
Hiya

I see the ProcessItemRemove Event doesn't pass any detail about the item being removed?! (unlike the very nice CurrentItem.BeforeDelete :-)

The only way I can think of knowing which item(s) are deleted is by constantly tracking the SelectionChange for the explorer and hoping the selection is what is being deleted.

Or can one tap into MAPI event with your MAPIStoreAccessor?


Thanks again for you help

Cheers
Craig
Posted 16 Nov, 2010 22:05:50 Top
Eugene Astafiev


Guest


Hello Craig,

Extended MAPI provides you with notifications (not events). There is a difference between notifications and events in .net terms. I.e. in the OnObjectDeleted event handler of the MAPI Store Accessor you can't get the deleted item. Instead, you will receive a notification. For example:


private void adxmapiStoreAccessor1_OnObjectDeleted(object sender, AddinExpress.MAPI.ADXMAPIObjectNotificationEventArgs e)
{
    System.Windows.Forms.MessageBox.Show("An item with ID: " + e.EntryId + " was deleted.");
}


Typically, when you delete a mail item it is trapped in the Deleted items folder. You can try to handle the ItemAdd event of the Items class in Outlook.
Posted 17 Nov, 2010 06:23:20 Top