title: Getting info from selected mail item in Outlook 2010
body: <p>I want to write an add-in for Outlook 2010. The idea is - user selects one mail item in folder, then presses the button on ribbon which starts the add-in. Add-in gets information from selected item, process it and displays result.
  I run in to problems when trying to get the Inspector of selected item. I tried:</p>
  
  <pre><code>Outlook.Inspector Point = this.Application.ActiveInspector().CurrentItem as Outlook.Inspector;
  Outlook.MailItem mailItem = Point.CurrentItem as Outlook.MailItem;
  </code></pre>
  
  <p>Of course this doesn't check if current item is actually an mail item but that's for later. My problem is, when i try running the program i get NullReferenceException.
  The only working examples of this I found on web was with <a href="http://msdn.microsoft.com/en-us/library/cc668191.aspx#Y684" rel="nofollow">event handling</a>. But I want to start add-in on button press..</p>
  
  <p>I am trying to make this in .NET 3.5 not 4</p>