Event Handler not being added to new Mail Items
问题 I'm trying to create a simple Outlook 2010 add-in that responds to new attachment events. The code below only works when I uncomment the MessageBox.Show line. But with it removed it appears not to add the event handler. What am I missing about the program flow that means that a modal message box affect the placement of event handlers? public partial class ThisAddIn { private void ThisAddIn_Startup(object sender, System.EventArgs e) { Application.Inspectors.NewInspector += Inspectors