MS-Excel / General Formatting

Creating Custom Tabs

The Ribbon in each Office application is divided into several tabs, and those tabs contain the groups and controls that expose the application's functionality.

With RibbonX, you can create your own custom tabs or you can customize any of the application's existing tabs.

Either way, your markup must appear between the
<tabs>
and
</tabs>
elements, so your tab-based RibbonX markup always begins like this:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <ribbon>
	<tabs>
	</tabs>
    </ribbon>
</customUI>

Creating a New Tab

If you're building an interface for a number of macros and user forms, you can make it easy for the user to find the custom tools by placing them within a new tab in the Ribbon. This gives you plenty of room to add whatever groups and controls you need to build your interface.

In RibbonX, you create a tab by using the <tab> element. Here's the basic syntax:

<tab id="ID" label="Label" InsertAfterMso="AfterID"
InsertBeforeMso="BeforeID" keytip="KeyTip">
</tab>
ID
A unique string identifier for the tab.

Label
The text that appears on the tab.

AfterID
The string identifier of the built-in tab after which you want your tab inserted. See the next section to learn about built-in tab identifiers.

BeforeID
The string identifier of the built-in tab before which you want your tab inserted.

KeyTip
The character or characters that appear when the user presses Alt. The user can then press the character or characters to choose the tab via the keyboard. Enter up to three alphanumeric characters.

Place your <tab> elements between the <tabs> and </tabs> elements in your XML markup file. Here's an example:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <ribbon>
	<tabs>
	    <tab id="CustomTab" label="My Tab" keytip="Z">
	    </tab>
	</tabs>
    </ribbon>
</customUI>
[Previous] [Contents] [Next]