title: Getting/setting MailItem permissions (classification) in Outlook 2010/2013 from VSTO addin
body: <p>I figured out how one can add custom classifications to Outlook (using a locally deployed classification.xml and related policy registry key). These custom values show up in the Permission split button menu and using the UI I can set the classification. However what I need to do is some custom action depending on the actively selected classification value. And here's my challenge. whatever is set in the UI doesn't seem to be reflected in the Permissions or PermissionTemplateGuid properties.
  Can anybody tell me how to get the active classification for a MailItem (more specifically the one currently being composed)</p>
  
  <p>EDIT: since the old working code addressed the problem by checking commandbar button status, which clearly will no longer work in Outlook 2013 - I'm also willing to accept an answer if you tell me how to make a ribbon based equivalent - as it's not possible to repurpose the built in PermissionRestrictMenu split button.</p>
  
  <pre><code>Office.CommandBarPopup permissionControl = mailItem.GetInspector.CommandBars.FindControl(Office.MsoControlType.msoControlPopup, AddinConfigurationManager.PermissionControlId, Type.Missing, Type.Missing)
                      as Office.CommandBarPopup;
  Office.CommandBarButton restrictedDistributionButton = GetRestrictedDistributionControlIndex(permissionControl);
  </code></pre>
  
  <p>where GetRestrictedDistributionControlIndex deals with permissionControl.get_accChild</p>