March 2007
Intermediate to advanced
704 pages
21h 31m
English
To add a macro to a tab, you need to declare the macro as a Ribbon control, and then create a button definition in customUI.xml that includes an onAction command. As you might know from creating custom toolbars or menus through VBA in previous Microsoft Office versions, you use onAction to identify the macro that runs when the specified button is clicked.
Examine, for example, the sample file Generate GUID.docm used in Chapter 22. This file contains one macro and uses a single Ribbon tab with a single button for running that macro.
The following image shows the contents of customUI.xml for this file.

Take note of the ...
Read now
Unlock full access