I use ApplicationEvents_11_ItemSendEventHandler (see http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.applicationevents_11_itemsendeventhandler.aspx ) to do some processing when an item is sent from Outlook.
However, since this event is triggered by โsendingโ and not โsendingโ, I cannot receive certain information, such as sender, time sent, etc.
Is there an alternative event that fires after an item is sent? I read this blog post; http://easyvsto.wordpress.com/2010/07/27/how-to-save-mail-content-when-a-mail-is-sent-from-outlook/ , but I am afraid depending on the elements appearing in the folder of sent items, given that the user can disable this feature.
Edit: I have to add that I actually tried the โwatch sent itemsโ approach and noticed that the ItemAdd event seems to fire only for the first message I sent, then not again until I restart Outlook. My code is as follows:
var sentMail = Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderSentMail); sentMail.Items.ItemAdd += new Outlook.ItemsEvents_ItemAddEventHandler(Items_ItemAdd);
And my method ...
void Items_ItemAdd(object item) { MessageBox.Show(((Outlook.MailItem)item).Subject); }
source share