B.2. Adding References to Your Projects

You know that you can automate Office applications by adding a reference to one of the libraries that comes with Microsoft Office, such as Microsoft Office 12.0 Object Library. Here are the steps necessary to add a reference, as well as what it means when you do:

  1. Press ALT+F11 to open the Visual Basic Editor and select Tools References to display the References dialog box, shown in Figure B-1.

    Figure B.1. Figure B-1
  2. The Available References list includes items that have been registered to the Windows System Registry. To add one of these libraries to references for your project, check the box to the left of its name. When you close and reopen the References dialog box, any libraries you have checked are listed above all unselected libraries.

  3. Many application installation packages handle registering libraries for you. If the library you want to use does not appear in the list of Available References, there are two ways to use the library:

    • Use the Browse button. Click the Browse button to open a file selection dialog box. Select the type of library you want from the drop-down list for Files Of Type. Browse to the folder that contains that library and select the library.

    • Register the library yourself. If the library is a 32-bit library (most are), ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.