Reputation: 31
I am working on an Excel add-in tool with a custom ribbon implementation. For this I need to find existing Excel ribbon tab ids and labels in Excel. How can I do this in C#?
Upvotes: 3
Views: 1152
Reputation: 16858
You can use the Globals class to access the Ribbon:
foreach (Ribbon ribbon in Globals.Ribbons)
{
// do something here
}
Refer: https://msdn.microsoft.com/en-us/library/bhczd18c.aspx
A ribbon inherits from a RibbonBase
class, which doesn't have an ID property as part of the object model, but does use a Name or RibbonID property as unique attributes.
More at: https://msdn.microsoft.com/en-us/library/microsoft.office.tools.ribbon.ribbonbase(v=vs.120).aspx
Upvotes: 1