I’m creating an Addin to be used in Outlook 2010 using Visual Studio 2008 (.Net 3.5). I have two separate ribbons defined. One of them is used to create context menus for attachments and the other is used to add a button to TabReadMessage.
I’m baffled as to how I’m supposed to get both of them to load. I have a function in ThisAddIn.vb that can’t possibly do what I want it to do – load both ribbons:
Protected Overrides Function CreateRibbonExtensibilityObject() As _
Microsoft.Office.Core.IRibbonExtensibility
Return New RibbonAttachAttachmentToPO()
Return New RibbonOutlook14ReadMail()
End Function
What is the best solution to this problem?
You will have 2 XML files, one for the TabReadMessage and one for the Attachment context menu.
And then you will need only one Ribbon class, CreateRibbonExtensibilityObject() loads the Ribbon class.
In the Ribbon class’s GetCustomUI() function, you will load the corresponding XML file base on which part of the Outlook you are in, whether in the explorer or inspector.
You can do this (VB.Net):