Access VBA Macro Programming

(Joao Candeias) #1

Microsoft has very helpfully provided a sample ribbon customization for Excel in this
application. To make this work, you must first load in a standard Excel 2007/2010 XML file
by using File | Open from the menu. Next, click Insert | Sample XML | Excel – A Custom
Tab. Why are we using Excel? Because there is no sample XML for Access, and as it happens
the Excel sample also works quite well in Access! The XML code shown in the Excel example
will help familiarize you with how to construct a ribbon before you start experimenting on
your own.
Your screen will now look like Figure 11-3. You can see a whole load of XML code,
which will provide a customization for the ribbon. A change you will need to make is in the
fourth row of the code. TabHome needs to be changed to TabHomeAccess in the InsertAfterMso
parameter. You also need to change GroupFont to GroupFontAccess in the sixth row.
Copy and paste the XML into the RibbonXML field in your USysRibbons table. One of
the annoying things about this table is that changes do not take place until the database has
been closed and reopened, so you must now do this.


Chapter 11: Working with the Ribbon 133


Figure 11-2 The opening screen of the Custom UI Editor for Microsoft Office

Free download pdf