1

I want to have a single ribbon in microsoft office, in which I will have all my add-ins. Let's say there are 2 add-ins, both are a single button on the ribbon, which then open a winform. The user installs the first add-in, the program checks for an installed ribbon, since there isn't any, it adds the ribbon and the button, which calls the add-ins function.

Then the user installs the second add-in later, which, instead of adding the same ribbon, checks if there is already a ribbon with the same name installed, and if there is, it only adds the button to the already installed ribbon, if there isn't(somehow the first add-in was uninstalled or something) it adds the ribbon with the button.

So I thought that in the ThisAddin_Startup event I instantiate a "RibbonController" class. In the RibbonController class i would check for the ribbons existence. (Every addin would have a RibbonController class)

Since I'm fairly new in the MS Office Add-in programming zone, i need help accessing the ribbons objects and creating it programmatically if it wasn't installed earlier.

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
Laureant
  • 979
  • 3
  • 18
  • 47

2 Answers2

1

I made a Ribbon.xml for every addin, that has the same structure. I've set a "namespace" in every ribbon.xml, that will help the controls to be added to the same tab, everytime.

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load" xmlns:x="NAMESPACE FOR EVERY TAB"> //the namespaces abreviation is "x"
    <ribbon>
        <tabs>
            <tab idQ="x:tab1" label="CommonTab" >
            ....

Then I set the tabs idQ with the "x:" prefix so it will know the namespace. From every add-in that uses the same xml structure, the controls from the tab will be added to a single tab.

Laureant
  • 979
  • 3
  • 18
  • 47
0

We use Add In Express at our work place. It's really easy to use and does everything. It's paid though.

Also please look at this answer.

Community
  • 1
  • 1
Mayank
  • 8,777
  • 4
  • 35
  • 60
  • And it can do the exact same thing as I was requesting? I would really like to do it without any third-party stuff, but if it's the only way, i have to convince my boss to buy it. – Laureant Sep 20 '14 at 08:06
  • It can do whole lot more. You can do it your self but you can't beat the price. For $450 you get tools that make your life much easier. I don't work for add-in-express but because I really like the tool as I use them at my work place. – Mayank Sep 20 '14 at 20:16
  • Thank you Mayank! The thing is, that I would really like to know a more basic approach to this, without third-party applications – Laureant Sep 22 '14 at 07:21
  • Thanks for the edit, but sadly it's not exactly what I wanted. I can't add add-in specific controls to that shared ribbon from the add-in itself. – Laureant Sep 23 '14 at 10:39