I'm trying to create an add-in for Outlook 2007/2010 to modify recipients of newly created email messages. Everything works fine if the user creates a new email message inside Outlook (I'm using the Inspectors.NewInspector
event). But if the user uses another application (MS Word or Adobe Acrobat for example) to try to email an attachment, the NewInspector
event isn't fired when the compose email window is displayed. Is there a straightforward approach to catching an event that is raised in a situation like this?
I've tried using the Application.ItemLoad
event, but I can't access any methods or properties after I successfully cast it to an Outlook.MailItem
(I get an error stating System.Runtime.InteropServices.COMException: The item’s properties and methods cannot be used inside this event procedure
). I'm using C# in Visual Studio 2010.