I need to modify visibilty of some controls in my ribbon (visual designer). This works fine while the ribbon is shown in the main Outlook window, but when it's shown in the mail read window, I can't find a working way to access my controls.
public void mailOpen(ref bool cancel)
{
Globals.Ribbons.Ribbon3.group1.Visible = true;
Globals.Ribbons[outlookApp.ActiveExplorer()].Ribbon3.group1.Visible = true;
}
throws no exception but my buttons are not visible. Same behavior if I try it in "inspector_activate" event
void Inspector_Activate()
{
Outlook.Inspector inspector = Globals.ThisAddIn.Application.ActiveInspector();
if (inspector != null && inspector.CurrentItem is Outlook.MailItem)
{
Globals.Ribbons[inspector].Ribbon3.group1.Visible = true;
}
}
I found some examples using the RibbonUI interface but these seems not applicable, because my ribbon is a visual designer ribbon. Is my goal possible or do I need to redesign my ribbon with XML?