Before using Automation, you need to set up references to the various applications' object libraries, also known as TypeLibs. By setting up references, you can strongly type variables (so that you can use data types such as Sheet and Chart instead of Object), get early binding, and use constants defined in the TypeLib. (Declaring Automation variables is described in more detail in the next section, “Declaring Object Variables in VBA.”)
Suppose that you want to set a reference to the Microsoft Word 9.0 TypeLib. In the database where you want to set up a reference, open the module editor with any module, and then follow these steps:
In the VBE, open the Tools menu and choose References.
Select Microsoft Word 9.0 Object ...