I've created an Outlook Add-In, and I'm using an XML ribbon configuration file to specify a new tab, and button. The button loads into a new tab within outlook. Now sometimes, based on user we want to be able to hide or disable these buttons. What's the simplest way to disable a menu button on a custom tab through the Outlook Interop api?
My first guess is that I need to iterate through some command bar collections after my ribbon is created, and then search for my menu buttons, but I'm not sure where these collections are.
protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
{
this.ribbon = new MyRibbon();
// loop through tabs and ribbon items, look for my custom control, and enabled/disable specific buttons.
return this.ribbon;
}