Access VBA Macro Programming

(Joao Candeias) #1

Chapter 11 Working with the Ribbon


Chapter 11 Working with the Ribbon


I


n Office 2007, an important change happened with the user interface. The ribbon style
menu structure superseded the previous menu structure. This probably had the greatest
impact on the user, since it defines how the user navigates through the Office menu
structure for each application.
If you use Access 2010/2007 already, then you will have come across the ribbon since you
access all the menu functions in a totally different and sometimes confusing way. Fortunately,
the VBA Editor window has maintained the same menu structure we all know and love, so
you can still use your accumulated knowledge here.
A number of Access VBA developers are producing Access add-ins that emulate the Access
classical menu. After reading this book, you may want to try your luck at doing the same.
The ribbon opens up a whole new way of programming the user interface. With Access 2003
and previous editions, you could create a menu structure for a form by using a macro (non-VBA
type). This is still there for purposes of backward-compatibility, but your menu now appears in a
menu option called Add Ins, while the rest of the ribbon structure remains as is.
The ribbon has meant learning a completely new way of creating a custom user interface.
In Access, it is slightly more difficult than the other Office components, such as Excel and
Word, because Access does not use the XML format for saving files.
You can customize the ribbon in Access 2010 by using the backstage view on the File tab
of the Access menu, but from a programming point of view it is better to work directly with
the XML source.
The ribbon is defined using XML. Because you cannot insert this straight into an XML
file for Access, you need to create a system table called USysRibbons. This table can hold


129

Free download pdf