7

I can not find any documentation to verify this or any working examples

I want to achieve something like this xml below, but I think this really is not possible.

<customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2010/01/customui">
  <ribbon>
    <tabs>
      <tab idMso="TabAddIns" label="Ribbon1">
      </tab>

      <tab idMso="TabAddIns" label="Ribbon2">
      </tab>
    </tabs>
  </ribbon>

</customUI>
Clinton Ward
  • 2,441
  • 1
  • 22
  • 26

3 Answers3

13

You can have multiple tabs, if you are using exiting tabs then set idMso="exiting tabids"

Existing tab ids should be valid ids which can be found here

If you are using your own custom tabs then use id="customtab1" instead of idMso

customtab1 - can be any valid strings

EDITED

The below ribbon xml worked

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <ribbon>
    <tabs>
      <tab idMso="TabAddIns" label="Ribbon1">
        <group id="MyGroup"
               label="My Group">
        </group>
      </tab>
      <tab id="CustomAddin" label="Ribbon2">
      <group id="CustomAddinGroup"
             label="My Group">
      </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

Try using Ribbon designer and convert to XML and make sure you add the below code in ThisAddin.cs file

protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
{
   return new Ribbon1();
}
Kiru
  • 3,489
  • 1
  • 25
  • 46
3

Change idMso for id and give your tabs a custom name.

<customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2010/01/customui">
  <ribbon>
    <tabs>
      <tab id="Tab1" label="Ribbon1">
      </tab>

      <tab id="Tab2" label="Ribbon2">
      </tab>
    </tabs>
  </ribbon>

</customUI>

idMso is used to refer to Microsoft Objects that already exists within the application hosting the ribbon.

dee-see
  • 23,668
  • 5
  • 58
  • 91
  • That didn't seem to work either, do you have a link or an example of this working in word? – Clinton Ward Aug 24 '13 at 13:27
  • 1
    I've used it myself in Excel. I'll see if I can get something for you when I get home. – dee-see Aug 26 '13 at 15:40
  • 1
    Tab with "id" instead of "isMso" works well for me. It is not possible to define "isMso" twice. It will override the Tab "add-ins". Thanks for your answer. – Jie Nov 07 '16 at 11:25
2

You cannot have two tabs with the same id (idMso="TabAddIns"). Make sure the ids are unique.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78