Creating Custom Groups
Within each tab on the Ribbon, related controls are organized into several groups, which makes it easier for the user to find a specific control. In your VBA application, you can use RibbonX to create your own custom groups on a new or built-in tab. You can also modify any of the built-in groups.
Your group-based markup must appear in the custom XML file between a <tab> and </tab> container.
Creating a New Group
If you have a lot of controls to add to a custom tab, you should probably organize them into groups to keep things organized. Even if you think your VBA application doesn't need multiple groups, note that you must create at least one group in your custom tab.
In RibbonX, you create a group by using the <group> element. Here's the basic syntax:
<group id="ID" label="Label" InsertAfterMso="AfterID" InsertBeforeMso="BeforeID"> </tab>
ID
A unique string identifier for the group.
Label
The text that appears below the group.
AfterID
The string identifier of the built-in group after which you want your group inserted. See the next section to learn about built-in group identifiers.
BeforeID
The string identifier of the built-in group before which you want your group inserted.
In your XML markup, place your <group> element between the <tab> and </tab> elements that represent the tab in which you want the group to appear. This can be either a custom tab or a built-in tab. Here's an example:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"> <ribbon> <tabs> <tab id="CustomTab" label="My Tab" keytip="AZ> <group id="CustomGroup" label="My Group" > </group> </tab> </tabs> </ribbon> </customUI>
In this tutorial:
- Customizing the Office 2007 Ribbon
- Understanding Ribbon Extensibility
- Extending the Ribbon: An Example
- Step 1: Create a Macro-Enabled Office Document or Template
- Step 2: Create a Text File and Add the Custom XML Markup
- Step 3: Copy the Custom XML Markup File to the Document Package
- Step 4: Rename and Open the Document
- Hiding the Built-In Ribbon
- Creating Custom Tabs
- Customizing an Existing Tab
- Creating Custom Groups
- Customizing an Existing Group