none
Delete event in Outlook RRS feed

  • Question

  • Hi,

    After spending a whole day digging the Outlook Interop library and the Internet, I'm still looking for an elegant way of monitoring Delete event for ANY mail item in ANY folder/sub-folder. Is there one? There's a not-so-elegant alternative of traversing through the folder tree at the application startup and hooking up with the BeforeItemMove of EACH folder/sub-folder, but I'm looking for something that works at application-level; just like the NewMail and NewMailEx events.

    I'm using VSTO + VS2010 + Outlook 2010 + .NETFx 3.5 if that helps.

    Thanks in advance.

     

    Shujaat

    Tuesday, November 22, 2011 7:28 AM

Answers

  • There's nothing that's application-wide for that.
     
    You have to do it folder by folder. In Outlook 2010 you do have the option to use the BeforeItemMove() event, but that's also exposed at the Folder level.
     
    You could trap ItemAdd() on the Items collection of the Deleted Items folder, but that would miss any hard-deleted items (Shift+Delete).

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Syed Shujaat Hussain" <=?utf-8?B?U3llZCBTaHVqYWF0IEh1c3NhaW4=?=> wrote in message news:c964952a-eada-4be7-8c4c-09453185f57c...

    Hi,

    After spending a whole day digging the Outlook Interop library and the Internet, I'm still looking for an elegant way of monitoring Delete event for ANY mail item in ANY folder/sub-folder. Is there one? There's a not-so-elegant alternative of traversing through the folder tree at the application startup and hooking up with the BeforeItemMove of EACH folder/sub-folder, but I'm looking for something that works at application-level; just like the NewMail and NewMailEx events.

    I'm using VSTO + VS2010 + Outlook 2010 + .NETFx 3.5 if that helps.

    Thanks in advance.

     

    Shujaat


    Ken Slovak MVP - Outlook
    Tuesday, November 22, 2011 2:18 PM
  • On the folder level you can also use the Items.ItemRemove event (which does not pass the the item being deleted to the event handler).

    In case of Exchange, you can also use the Incremental Change Synchronization API (ICS) either in Extended MAPi (C++ or Delphi) or in Redemption (RDOFolderSynchronizer object - http://www.dimastr.com/redemption/rdofoldersynchronizer.htm)


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!
    Wednesday, November 23, 2011 8:00 PM

All replies

  • There's nothing that's application-wide for that.
     
    You have to do it folder by folder. In Outlook 2010 you do have the option to use the BeforeItemMove() event, but that's also exposed at the Folder level.
     
    You could trap ItemAdd() on the Items collection of the Deleted Items folder, but that would miss any hard-deleted items (Shift+Delete).

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Syed Shujaat Hussain" <=?utf-8?B?U3llZCBTaHVqYWF0IEh1c3NhaW4=?=> wrote in message news:c964952a-eada-4be7-8c4c-09453185f57c...

    Hi,

    After spending a whole day digging the Outlook Interop library and the Internet, I'm still looking for an elegant way of monitoring Delete event for ANY mail item in ANY folder/sub-folder. Is there one? There's a not-so-elegant alternative of traversing through the folder tree at the application startup and hooking up with the BeforeItemMove of EACH folder/sub-folder, but I'm looking for something that works at application-level; just like the NewMail and NewMailEx events.

    I'm using VSTO + VS2010 + Outlook 2010 + .NETFx 3.5 if that helps.

    Thanks in advance.

     

    Shujaat


    Ken Slovak MVP - Outlook
    Tuesday, November 22, 2011 2:18 PM
  • On the folder level you can also use the Items.ItemRemove event (which does not pass the the item being deleted to the event handler).

    In case of Exchange, you can also use the Incremental Change Synchronization API (ICS) either in Extended MAPi (C++ or Delphi) or in Redemption (RDOFolderSynchronizer object - http://www.dimastr.com/redemption/rdofoldersynchronizer.htm)


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!
    Wednesday, November 23, 2011 8:00 PM