Summary

This chapter dealt with creating Access add-ins in the Access 2007 (.accda) library database format (you can use the same techniques to create add-ins in the older .mda format for use with databases created in previous Access database formats as well as Access 2007). Access add-ins let you encapsulate a set of database objects (primarily code and forms), for use in any Access database, as a way of adding extra functionality to a database without the need to manually import objects into any database where you need the functionality.

The next chapter covers using Ribbon XML to work with the Access ribbon, in Access add-ins as well as other types of add-ins.

p'ígu

XML in Access atabases and Add-ins

As a power user or developer, you may be used to manually customizing the Access toolbars and menus, removing controls you don't need, moving others to more convenient locations, and in general reorganizing the toolbars and menus just as you prefer, and you may have written functions to run from custom toolbar buttons or menu commands. If you expect to continue these practices in Access 2007, you're in for a shock.

The new Office 2007 Ribbon is a major interface change for Access (as well as the other Office applications), and it requires a major change in programming techniques for customizing the Access interface. Instead of working with the CommandBars collection to create menus and toolbars, or add commands to the standard ones, you customize the Ribbon with XML code stored in a table, working with tabs and groups instead of menus and toolbars (although the Ribbon does include one menu — the Office menu — and one toolbar — the Quick Access Toolbar).

For other Office applications, such as Word and Excel, Ribbon customization requires creating and loading a separate XML document, but in Access, you have a much more convenient option: just create a table containing the XML code for creating the Ribbon, load it automatically by closing and reopening the database, and then select the Ribbon you want to use from the Access Options screen. After one more closing and reopening of the database, your Ribbon customizations will appear.

in this chapter

Customizing the Ribbon in an Access database

Customizing the Ribbon with an

Access add-in

Tools for working with XML code

Sources of Information on Customizing the Ribbon

The MSDN document "Customizing the Office (2007) Ribbon User Interface for Developers" (Parts 1 through 3) is a very useful reference when creating Ribbon XML for Access (and other Office applications).

The list of Control IDs (Access Ribbon Controls.xls) is invaluable for working with the Ribbon; it lists the control, group, and tab names you need to use when creating Ribbon XML code. You can download this worksheet from http://www.microsoft.com/downloads/details.aspx?family id=4329d9e9-4d11-46a5-898d-23e4f331e9ae&displaylang=en on the Microsoft web site.

Several blogs are also valuable resources for information on working with the Ribbon in VBA or VB code: In Erik Rucker's blog, see the July 13, 2006 posting on Customizing the New Access UI for information on customizing the Access Ribbon. The blogs maintained by Jensen Harris and Patrick Schmid have lots of valuable information on Ribbon customization (Jensen Harris is the program manager in charge of the Office UI team, and Patrick Schmid is an MVP). The Third of Five blog is also useful. See the Office Developer Center web site for the latest list of Office-related blogs. However, note that this worksheet was last updated in November 2006, and some of the names have changed since then, so it is not entirely accurate, especially for group and tab names.

Here are links to the resources mentioned in the previous paragraph:

■ Customizing the Office (2007) Ribbon User Interface for Developers, Parts 1 through 3:

http://msdn2.microsoft.com/en-us/library/ms4 06 04 6. aspx#OfficeCustomizingRibbonUIforDevelopers_AppLevel

http://msdn2.microsoft.com/en-us/library/aa338199.aspx

http://msdn2.microsoft.com/en-us/library/aa722 52 3.aspx

■ Office 2007 Developer Center: http://msdn2.microsoft.com/en-us/office/ aa905358.aspx

■ Ribbon Extensibility in Access 2007: http://msdn2.microsoft.com/en-us/ library/bb1873 98.aspx

■ Transitioning Your Existing Access Applications to Access 2007: http://msdn2. microsoft.com/en-us/library/bb2 03 84 9.aspx

■ Erik Rucker's blog: http://blogs.msdn.com/access

■ Jensen Harris' blog: http://blogs.msdn.com/jensenh/default.aspx

■ Patrick Schmid's blog: http://pschmid.net/blog/2006/10/09/58

■ Third of Five Blog: http://blogs.msdn.com/thirdoffive/

0 0

Post a comment