Customizing an Existing Group
If you have one or two macros that you want to add to the Ribbon and those macros are related to the controls in a built-in group, you can add controls for those macros to the group. To work with a built-in group, you use the <group> element with the following (simplified) syntax:
<group idMso="ID" visible="true|false"/>
ID
The unique string identifier for the built-in group.
The value of the idMso attribute takes one of the following forms:
- GroupName-This is the most common form and it's used for most regular built-in groups. Here, Name is the name that appears under the group, with spaces removed. For example, the isMso value for Word's Font group (Home tab) is GroupFont, and the value for Excel's Function Library group (Formulas tab) is GroupFunctionLibrary.
- GroupTabName-This form combines the Tab in which the group appears and the Name of the group. For example, the idMso value for Word's Text group on the Insert tab is GroupInsertText.
- GroupNameApplication-This is the form used for groups that are common to multiple applications. Here, Name is the name of the group and Application is the name of the application. So the isMso value for Word's Themes group (Page Layout tab) is GroupThemesWord, whereas the value for Excel's Themes group is GroupThemesExcel.
Again, the group names aren't fully consistent across the Office 2007 applications.
You'll work with built-in tabs in more detail later in this tutorial when you learn how to add controls to existing tabs. For now, you can use the visible attribute to hide built-in groups that you don't want the user to see. For example, the following XML code hides the Macros group (View tab):
<tab idMso="TabView"> <group idMso="GroupMacros" visible="false" /> </tab>
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