Reputation: 379
I've got two add-in that need to create a group of buttons in a custom tab. I'm trying to use the same Custom tab for the 2 add-ins, and so to create the two groups in this custom tab.
I've tried to set the same namespace, the same tab Id, but whatever, each time two custom tab are created, with in each one the group created by each add-in...
Is there a way to get that work?
Here is an example for the custom UI xml for the first add-in :
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="MYCOMPANYRibbonOnLoad" xmlns:x="MYCOMPANYSpace">
<ribbon startFromScratch="false">
<tabs>
<tab id="MYCOMPANYTab" label="MYCOMPANY" insertAfterMso="TabView">
<group id="IDGroup1" label="LabelGroup1">
<button id="Group1customButton1" (etc...)/>
<button id="Group1customButton2" (etc...)/>
<button id="Group1customButton3" (etc...) />
<button id="Group1customButton4" (etc...) />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
And Here is an example for the custom UI xml for the second add-in :
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="MYCOMPANYRibbonOnLoad" xmlns:x="MYCOMPANYSpace">
<ribbon startFromScratch="false">
<tabs>
<tab id="MYCOMPANYTab" label="MYCOMPANY" insertAfterMso="TabView">
<group id="IDGroup2" label="LabelGroup2">
<button id="Group2customButton1" (etc...) />
<button id="Group2customButton2" (etc...) />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Upvotes: 2
Views: 2248
Reputation: 379
I've finally found the solution :
First you have to declare your own namespace like this:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" xmlns:n="http://ISBN3-86063-989-7.com/RibbonXML" onLoad="RibbonOnLoad">
Then you need to use the idQ attribute in conjunction with your namespace alias (and not only Id attribute as I did first):
<tab idQ="n:YourCustomTab_Id" label="YourCustomTab_Name" insertAfterMso="TabView">
If you want to separate with group, you need to declare groups in the same way:
<group idQ="n:YourCustomGroup1_Id" label="YourCustomGroup1_Name">
It worked well in my case...
Upvotes: 2