3

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#?

honk
  • 9,137
  • 11
  • 75
  • 83
Rohit
  • 31
  • 1

1 Answers1

1

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

Phil.Wheeler
  • 16,748
  • 10
  • 99
  • 155