1

Working on the VSTO Add-in for Outlook. Is there anyway to avoid duplicating the whole ribbon XML code if I just want the same buttons to appear under two different tab/view (TabCalendar and TabMail) My ribbon code is the following:

<ribbon>
  <tabs>
    <tab idMso="TabMail">
      <button id="ID1" label="XxX" onAction="OnTextButton" image="myImg1" size="large" getVisible="GetVisible"/>
      <button id="ID2" label="XxX" onAction="OnTextButton" image="myImg2" size="large" getVisible="GetVisible"/>
      ...
    </tab>
    <tab idMso="TabCalendar">
      <button id="SameThanID1" label="XxX" onAction="OnTextButton" image="myImg1" size="large" getVisible="GetVisible"/>
      <button id="SameThanID2" label="XxX" onAction="OnTextButton" image="myImg2" size="large" getVisible="GetVisible"/>
     ...
    </tab>
  </tabs>
</ribon>

What I would love to to is:

<ribbon>
  <tabs>
    <tab idMso="TabMail" OR "TabCalendar">
      <button id="ID1" label="XxX" onAction="OnTextButton" image="myImg1" size="large" getVisible="GetVisible"/>
      <button id="ID2" label="XxX" onAction="OnTextButton" image="myImg2" size="large" getVisible="GetVisible"/>
      ...
    </tab>
  </tabs>
</ribon>

It is really annoying as the button needs to be unique and I therefore have to duplicate the same logic. I read this post which is not really encouraging. Is there any option?

Salim
  • 495
  • 3
  • 20

1 Answers1

0

The Fluent UI (aka Ribbon UI) doesn't allow to combine built-in tabs markup and place the ribbon XML into a single place. You need to specify (repeat) the markup for each built-in tab separately. Read more about the ribbon UI in the following series of articles:

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45