c# - Outlook Add-in, RibbonType Microsoft.Outlook.Explorer and Microsoft.Outlook.Mail.Read -
i have outlook 2010 add-in coded in .net 4.0/vs.net 2010, c#. add-in extends ribbon => adds ribbontab
4 ribbonbuttons (ribbontype
property set to) microsoft.outlook.explorer
, microsoft.outlook.mail.read
.
now, if user clicks on 1 of ribbonbuttons, how can determine if user clicked on button added microsoft.outlook.explorer
or microsoft.outlook.mail.read
?
one option create (2) ribbons shared capability library. when call shared library - can pass context of ribbon action clicked.
the better choice though check activewindow
property of application determine context user in via thisaddin.application.activewindow()
.
var windowtype = globals.thisaddin.application.activewindow(); if (windowtype outlook.explorer) { outlook.explorer exp = type outlook.explorer; // have explorer context } else if (windowtype outlook.inspector) { outlook.inspector exp = type outlook.inspector; // have inspector context }
Comments
Post a Comment