Although you can’t customize the standard Ribbon tabs and groups, you can add new tabs and
groups to the Ribbon, though the technique is completely different than writing VBA code to work
with CommandBars, as in past versions of Access. There are several steps to customizing the
Ribbon in an Access database:
- Write XML code to define the Ribbon customizations.
- Create a table in the Access database to store the Ribbon names and their XML code.
- (Optional) Write VBA callback procedures to run from custom Ribbon command but-
tons. - Close the database, then reopen it, to load the Ribbon(s) from the table.
- Select the Ribbon to load into the database.
- Close and reopen the database to load the Ribbon.
In addition to creating the XML code, VBA code (if needed), and table, you also have to close and
reopen the database twice to get the Ribbon customizations to appear — once to load the Ribbon,
and again after selecting the Ribbon to use in the database. The next few sections guide you
through customizing the Ribbon in an Access database.
The sample database for this section is Test Ribbon.accdb.
NOTENOTE
Customizing the Ribbon with XML in Access Databases and Add-ins 15
Why do I keep calling it a customization deficiency?
Microsoft decided that in order to make those 99.7% of all users happy, one toolbar was enough. In
order to prevent accidental customization and make sure users always have that toolbar accessible,
it became non-floatable. Born therefore was the Quick Access Toolbar. That is not the end of the
customization story though. There is also one Ribbon tab that you can hide or show, namely the
Developer tab. You can also customize the status bar fully. Toolbars and menus created in a previous
Office version and by legacy (meaning non-Office 2007) add-ins can also be used, but not created,
in 2007. Last, but not least, galleries can be customized. Some “customize” themselves automati-
cally, e.g. the recent document list or the shapes gallery. Others can be manually customized, espe-
cially in Word. For example, the galleries for page numbers, headers and footers can be customized
by the user.
But that’s it. Seriously, that is it. Everything else, especially the vast majority of the Ribbon, is static
and cannot be customized. Therefore, describing Office 2007 as having a “customization defi-
ciency” or complaining about the lack of customization in it, reflects appropriately the state of affairs
in 2007.