Search code examples
c#outlookoutlook-2007

Capture BeforeItemCopy event in Outlook


Outlook 2007 Interface How to capture the copy event which is fired after clicking "Copy" list item from "Edit" menu, for a selected attachment item in the preview pane in Outlook ?

I tried binding following events but ended up, they only fire when mail items are selected

 ((Outlook.ExplorerEvents_10_Event)Explorer).BeforeItemCopy += new Microsoft.Office.Interop.Outlook.ExplorerEvents_10_BeforeItemCopyEventHandler(ExplorerWrapper_BeforeItemCopy);
 ((Outlook.ExplorerEvents_10_Event)Explorer).BeforeItemCut += new Microsoft.Office.Interop.Outlook.ExplorerEvents_10_BeforeItemCutEventHandler(ExplorerWrapper_BeforeItemCut);

Is it possible to achieve what I am trying to do ? Please provide sample codes. (Outlook 2007)

Thank you


Solution

  • You need to find the CommandBarButton control and subscribe to the Click event. Try to play with the CommandBars property of the Explorer class from the Outlook object model and you will be able to find the target (Copy) control.