Share via


Deploy the 2007 Office system with a customized Ribbon

Updated: January 21, 2008

Applies To: Office Resource Kit

This Office product will reach end of support on October 10, 2017. To stay supported, you will need to upgrade. For more information, see , Resources to help you upgrade your Office 2007 servers and clients.

 

Topic Last Modified: 2016-11-14

In this article:

  • About Ribbon customization

  • Methods of customizing the Ribbon

  • Customizing the Ribbon by using Office Open XML

  • Creating a sample Word tab by using XML markup

  • Deploying the custom solution

The new user interface in the 2007 Microsoft Office system, the Microsoft Office Fluent user interface (UI), is designed to provide a simpler and more discoverable way for users to complete their work in Office. The Office Fluent UI includes the Ribbon, a strip of logically grouped commands on a series of tabs that runs across the top of an application in 2007 Office system. The Ribbon replaces the menus and toolbars of earlier versions of Office.

You can customize the Ribbon for your organization by using XML and programming code. This article provides links to resources that describe Ribbon customization in detail, and explains the steps for deploying a customized Ribbon to your users. Keep in mind that Microsoft Office Access 2007 and Microsoft Office Outlook 2007 implement customization slightly differently than Microsoft Office Word 2007, Microsoft Office Excel 2007, and Microsoft Office PowerPoint 2007.

About Ribbon customization

Customizing the Ribbon enables users or organizations to modify the UI, by using XML, for their specific needs. You can add or hide tabs for specific common commands and create custom tabs. You can also rearrange the commands on the Ribbon to suit your specific functionality.

Methods of customizing the Ribbon

You can customize the Ribbon by using one of the following methods:

  • COM add-in   Create a COM add-in project in Microsoft Visual Studio.

  • Microsoft Office add-in   Create a Microsoft Office add-in project in Microsoft Visual Studio Tools for Office, Second Edition (VSTO 2005 SE).

  • Template file   Create a template file for a 2007 Office system application document; for example, a .dotx file for Office Word 2007.

The method you use to customize the Ribbon is based on your experience. Working with XML markup can be done easily within Notepad and is considerably easier than traditional coding. The alternative is you can launch VSTO 2005 SE and with minimal code, have a Ribbon customized project in a few steps by using the built-in templates. VSTO 2005 SE focuses for 2007 Office system add-ins, but also allows for Office 2003 add-ins.

Customizing the Ribbon by using Office Open XML

Customizing the Ribbon by using Office Open XML requires a minimum of three components:

  • The folder structure for customUI, _rels, _docProps, and the application

  • The customUI.xml file

  • The .rels file

Note

Office Open XML Format is a compressed file with a .zip file name extension.

The customUI folder stores the customIU.xml file, which describes the customization that is being done. The _rels folder stores the .rels file, which identifies the relationships that are defined between the folders and the package. The _docProps folder lists the elements and properties of the document. The application folder names the application that is being customized.

Creating a sample Word tab by using XML markup

Use the following procedure to create a Word tab by using XML markup.

Create a sample Word tab

  1. Open Office Word 2007, and then save a blank document as New Tab.docx.

  2. Rename New Tab.docx to New Tab.docx.zip. This will create the folder structure needed as one of the components.

  3. Open New Tab.docx.zip and modify the customUI.xml file within the customUI folder by using Notepad. For example:

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

    **  <tabs>**

    **    <tab id="customTab" label="New Tab">**

    **      <group id="customGroup" label="Test Sample">**

    **        <button idMso="PasteSpecialDialog" visible="true" size="small" label="Choose a Paste Option" />**

    **        <button idMso="FileSave" visible="true" size="small" />**

    **      </group>**

    **    </tab>**

    **  </tabs>**

    </ribbon>

    </customUI>

  4. Add the relationship to the .rels file located in the _rels folder.

  5. Copy the .rels file out of the *.zip folder and make the following modification:

    <Relationship Type="https://schemas.microsoft.com/office/2006/relationships/ui/extensibility" Target="/customUI/customUI.xml" Id="rId#" />

    Where the Id is assigned to a number not already used

  6. Save the file and copy it back to the *.zip folder, overwriting the existing .rels file.

  7. Rename the *.zip file back to *.docx and open it to see the new Word tab.

For a complete list of the Control IDs that can be downloaded to assist with Office Open XML editing, see 2007 Office System Document: Lists of Control IDs (https://go.microsoft.com/fwlink/?LinkId=107549).

To view a webcast about customizing the Ribbon by using Office Open XML, see Microsoft Office System Webcast: Advanced Tips and Tricks: Customizing the Ribbon Using Office Open XML (https://go.microsoft.com/fwlink/?LinkId=107551).

Deploying the custom solution

The deployment method you use to provide a customized UI to your users depends on the customization method you chose: COM add-in, Microsoft Office add-in, or template file.

Note

If you customize the Ribbon by using a COM add-in or by creating a Microsoft Office add-in, you must distribute the application to the users' computers for the new Ribbon to appear in Office applications. The new VSTO Clickonce installer will automatically check for and install necessary prerequisites to set up the environment, making deployment much easier.

For information about deploying the Ribbon that was created by using a COM add-in, see Deploying Application-Level Add-ins (https://go.microsoft.com/fwlink/?LinkId=107557).

For information about deploying the Ribbon that was created by using a Microsoft Office add-in, see Visual Studio Tools for Office (https://go.microsoft.com/fwlink/?LinkId=107558).

For more information about deploying the Ribbon by using VSTO 2005 SE, see How to: Deploy Office Solutions (https://go.microsoft.com/fwlink/?LinkId=107559).

To distribute a template file to users that provides a customized Ribbon for a specific document, you can also use the Office Customization Tool (OCT). For more information about using the OCT to distribute files, see Add files in Office Customization Tool in the 2007 Office system.