title: Listening to the item move event with outlook add-in
body: <p>I want to do some functionality when user moves a  mail item (from a folder to another folder).  So I want to capture the mail item move event with the outlook add-in.
  I think this should be possible with following event handlers,</p>
  
  <pre><code>MAPIFolderEvents_12_BeforeItemMoveEventHandler
  ItemsEvents_ItemRemoveEventHandler
  </code></pre>
  
  <p>I tried with both of the above event handles. But they didn’t work for me. Could someone provide an example. Here is the code for <code>MAPIFolderEvents_12_BeforeItemMoveEventHandler</code>.</p>
  
  <pre><code>    Outlook.Folder fldr;
  
      private void ThisAddIn_Startup(object sender, System.EventArgs e)
      {
          fldr = (Outlook.Folder)Application.Session.GetDefaultFolder(OlDefaultFolders.olFolderTasks);
          fldr.BeforeItemMove += new Microsoft.Office.Interop.Outlook.
               MAPIFolderEvents_12_BeforeItemMoveEventHandler
               (Folder_BeforeItemMove); 
      }
  
      private void Folder_BeforeItemMove(object anItem, MAPIFolder aMoveToFolder, ref bool Cancel)
      {
          Outlook.MailItem mailItem = (anItem as Outlook.MailItem);
          //Do other stuff
      }
  </code></pre>