yoozz
yoozz

Reputation: 249

How can I add an existing button/group from a ribbon tab to a new custom tab?

I am developing an VSTO Addin and I want to create a new tab with buttons from other tabs. I already created the new tab, but I can't succeed adding the existing buttons and groups.

Upvotes: 1

Views: 2145

Answers (2)

Job JPb
Job JPb

Reputation: 21

You could try it. But you can't change group (https://social.msdn.microsoft.com/Forums/vstudio/en-US/3391b0a8-9dea-4372-b28c-ca62b9420f25/customizing-an-existing-ribbon?forum=vsto)

But you could hide and show your own override: see idea (http://www.rondebruin.nl/win/s2/win016.htm)

For ex:

  <!-- Set visible to false for the Clipboard group on the Home tab-->
  <tab idMso="TabHome">
    <group idMso="GroupClipboard" visible="false"/>
  </tab>


  <!-- Point to the Built-in tab to the ribbon -->
  <tab idMso="TabHome">

    <!-- Add Clipboard group -- And hear you could add your controls   >
    <group id="DupClipboard" label="Clipboard" insertBeforeMso="GroupClipboard" >
      <splitButton idMso="PasteMenu" size="large" />
      <button idMso="Cut"/>
      <button idMso="Copy"/>
      <control idMso="FormatPainter"/>

      <dialogBoxLauncher>
        <button  idMso="ShowClipboard" />
      </dialogBoxLauncher>
    </group>

  </tab>

Upvotes: 0

yoozz
yoozz

Reputation: 249

I succeeded! In the XML file, in the custom tab section, add: for adding a group:

<group idMso="existing group id"></group >

Upvotes: 2

Related Questions