I'm currently reparing an Outlook VSTO Addin. The project contains 4 ribbons with their respective Ribbon Type:
- CrmAppointmentRibbon.cs -> Type: Microsoft.Outlook.Appointment
- CrmEmailNewRibbon.cs -> Type: Microsoft.Outlook.Mail.Compose
- CrmEmailReadRibbon.cs -> Type: Microsoft.Outlook.Mail.Read
- CrmEmailRibbon.cs -> Type: Microsoft.Outlook.Mail.Explorer
So when Outlook opens, the method ThisAddIn_Startup is called to initialize the Addin and I'm getting the ribbon collection as follows:
ThisRibbonCollection ribbonCollection = Globals.Ribbons[Globals.ThisAddIn.Application.ActiveInspector()];
So the ribbonCollection contains the 4 ribbons but there is a mismatch concerning the class type of the CrmEmailRibbon variable of the ribbonCollection. When I do
ribbonCollection.CrmEmailRibbon
It returns the CrmEmailReadRibbon instead of CrmEmailRibbon. So the CrmEmailReadRibbon is returned twice. It's the same ribbon returned from this two calls:
ribbonCollection.CrmEmailRibbon
ribbonCollection.CrmEmailReadRibbon
The first call should return its associated ribbon reference: CrmEmailRibbon. Because of that I cannot access to the groups and buttons of the CrmEmailRibbon... Did somebody encounter this behaviour ?