MS-Excel / General Formatting

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>
[Previous] [Contents] [Next]