Adding the Customizations

Adding RibbonX customizations to a workbook requires just two steps:

1. Create the XML to define the required customization.

2. Insert the XML into the workbook's file (which must be using one of the XML file formats).

The first step is the subject of the remainder of this chapter. You can add the XML part to the workbook by hand or programmatically, using the techniques shown in Chapter 12. The following changes need to be made:

□ Add the XML file to the workbook's zipped structure. By convention, it has the name /customUl/customUl.xml, though any other name can be used. It's a good idea to put the XML part into its own folder, because you may need to store button images in there as well.

□ Edit the root rels file to include a reference to the new XML part, such as:

□ <Relationship Type="http://schemas.microsoft.com/office/2 00 6/ relationships/ui/extensibility" Target="/customUI/customUI.xml" Id="rID5" />

□ The important thing to get right is the relationship Type attribute, because that is what Excel looks for to see if the relationship is for a RibbonX customization. Note that because this is XML, it is case-sensitive, so it's critical to get the correct capitalization.

These changes are easily made by hand using the Office 2007 Custom UI Editor utility, available to download from http://openxmldeveloper.org/articles/CustomUIeditor.aspx.

0 0

Post a comment