12.5. Specifying the Custom Ribbon

Once you write a ribbon customization, you need some way to display it for your database, form, or report. That's where the new Ribbon Name property (in the Current Database group of the Access Options dialog box) comes in. To set the Ribbon for a database, you just set this property to the name of a ribbon in the USysRibbons table. Your custom ribbon displays when you re-open the database.

For form and report Ribbons, set the Ribbon Name property on the Other tab of the form or report property sheet.

12.5.1. Defining a Ribbon Using XML

Before jumping in to write the XML, there is one change to make to your Access environment. By default, any errors that may be caused by the XML are not displayed. Instead, the customization may fail without warning and not load. To see the errors, you must enable the Show Add-In User Interface Errors option in the General section of the Advanced group of the Access Options dialog box.

You can write XML using a text editor such as Notepad, or an integrated development environment (IDE) such as Visual Studio or XML Spy. The examples in this chapter use Microsoft Visual Web Developer 2005 Express Edition, which at the time of this writing is freely available for download from the Microsoft website, http://msdn.microsoft.com/vstudio/express/vwd.

Many IDEs such as Visual Web Developer provide auto-completion, or IntelliSense, when an XML Schema (XSD) is available. Because the XML you write here is based on a schema, ...

Get Access™ 2007 VBA Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.