I have an Outlook 2010 plugin using VSTO that converts attachments before they are added to mail items. The way I accomplish this is to register for new inspector events in the plugin startup
inspectors = Application.Inspectors; inspectors.NewInspector += new Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(OnNewInspector);
then in the new inspector event handler, check for a mail item and register for the BeforeAttachmentAdd event. Then in BeforeAttachmentAdd I perform the conversions on the attachment data.
This all works well when composing messages from within Outlook.
The problem I am trying to solve is when the user attempts to "Send As Attachment" directly from another Office application (e.g. the current document being edited in Word or current spreadsheet in Excel).
In this case, my new inspector event handler never fires. A new inspector window launches with the Office document already attached. I noticed that if I registered for Application.ItemLoad event this is invoked when the other application performs the "Send As Attachment", but event if the object Item is a MailItem and I register for BeforeAttachmentAdd my attachment add event handler never fires.
Any ideas on what events my plugin should be registering for so that it can convert these Office-sent attachments before they are added to the mail item?