How to add a group to multiple built-in Ribbon tabs (vsto)?

Related searches

This is VS2010 + Office 2010 add-in. All I want is to add a button (or button group) to multiple built-in tabs. For example, my buttons should be available in both New Mail Message Ribbon and in New Appointment Ribbon. I have tried adding a new tab (in the Visual Designer) but that doesn't seem to work. The button group appears on the New Mail Message tab, but not on the Appointment tab. BTW, I'm using the following IDs: TabNewMailMessage and TabAppointment.


For anyone else pulling their hair about this, the only way I was able to see my group on both Appointment and New Mail Message tabs was by adding one Ribbon for each built-in tab, and then copy/pasting all of the UI and code from one Ribbon to the other. Make sure you choose proper RibbonType (a property of your Ribbon) for each built-in tab.

How to add a group to multiple built-in Ribbon tabs (vsto)?, How to add a group to multiple built-in Ribbon tabs (vsto)?. 发布于 2020-05-03 07:44:07. This is VS2010 + Office 2010 add-in. All I want is to add a button (or� In the Ribbon Designer, select a custom group. In the Properties window, expand the Position property. Set the PositionType property to the appropriate value: BeforeOfficeId positions the group before a specified built-in group. AfterOfficeId positions the group after a specified built-in group.


The designated answer is now obsolete!

  1. On the OfficeRibbon object, set the RibbonType for as many cases as necessary (e.g. Microsoft.Outlook.Explorer and Microsoft.Outlook.Mail.Read).
  2. Add a first Tab and set the ControlId.OfficeId (e.g. TabMail)
  3. Add another Tab and set the ControlId.OfficeId (e.g. TabReadMessage)
  4. In each Tab add a Group and a Button within and set the Button.Click event to point to the same OnClick method

How to add a group to multiple built-in Ribbon tabs (vsto)?, For instance, you can add a custom Ribbon group to a built-in tab. To do Sharing Ribbon controls across multiple add-ins on the same page. As far as I can tell, you can only add groups to built tabs, you can't add controls to built in groups. If you want to add a group to a built in tab: Visual Designer: Set the ControlTypeId of the tab to Office and the ControlId to TabMailings, you can then add items to it like it were the Mailings tab. Ribbon XML: just do something like this


Similar to the answer above but without using XML, you can have the group in two different locations adding a second tab.

In the Ribbon Designer add a second tab to the ribbon and change the ControlID to the second location you would like to see your group. Then right click on the group in the original tab and click copy. Click back over to the new tab and paste the group there. It will copy over anything that is already in the group. You will, however, have to add the events back in. But for me I just re-used the already created events and it works perfectly. CHEERS.

Add a new ribbon group to a system-defined ribbon, You can add groups and controls to a built-in tab. A built-in tab is a tab that's already on the Ribbon of a Microsoft Office application. applies to document- level projects and VSTO Add-in projects for the following applications:� Use the Ribbon (XML) item to customize the ribbon in the following ways: Add built-in groups to a custom tab or built-in tab. Add built-in controls to a custom group. Add custom code to override the event handlers of built-in controls. Customize the Quick Access Toolbar. Share a Ribbon customization between VSTO Add-in by using a qualified ID.


I don't have Outlook, but I have used the following in Word/Excel/PPT, so I'm hoping it will work in Outlook as well (untested!).

Try adding an Ribbon (XML) item and then add the two tabs with a button that looks the same and calls the same code but with different IDs.

XML:

<tab idMso="TabNewMailMessage">
    <group id="MyGroup1" label="My Group1">
        <button id="myButton1" label="Button 1" size="large"  onAction="ButtonOnAction" />
    </group>
</tab>
<tab idMso="TabAppointment">
    <group id="MyGroup2" label="My Group2">
        <button id="myButton2" label="Button 2" size="large"  onAction="ButtonOnAction" />
    </group>
</tab>

C#:

    public void ButtonOnAction(IRibbonControl control)
    {
        switch (control.Id)
        {
            case "myButton1":
            case "myButton2":
                // do something
                Console.Out.WriteLine("Button ID: {0}", control.Id);
                break;
        }
    }

How to: Customize a built-in tab, A built-in tab or group is one that already exists on the ribbon of a Microsoft Office application. Share a Ribbon customization between VSTO Add-in by using a qualified ID. For more Add multiple Ribbon items to a project. You may only add controls to custom groups in Office 2007/2010. The built-in groups are really a different thing than the custom groups that you may add. For example, you will see for example that the built-in groups such as the ones for font and paragraph formatting behave differently with respect to resizing the application window.


Ribbon overview, This file contains the Ribbon class. This class has the name that you specified for the Ribbon (XML) item in the Add New Item dialog box. Microsoft Office applications use an instance of this class to load the custom Ribbon. Note: By default, these files add a custom group to the Add-Ins tab in the Ribbon. Displaying the Custom Ribbon in a


Select the built-in tab you want to add a group to and click the “ New Group ” button below the list of tabs. Rename that group as we showed you earlier. Then you can add commands to the new group on the built-in tab, in the same way you can add commands to a new custom tab.


You can use the Ribbon Designer to add controls to the menu that opens when you click the File tab. When you run the application, controls that you add to the File tab appear a group named Add-ins. You cannot position controls before or after built-in controls by using the Ribbon designer in Visual Studio.