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>
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