< Day Day Up > |
Automation clients need a way to determine which objects they can use from any given automation server. This information is stored in files called type libraries, which normally have a .tlb or .olb extension. A type library contains information on:
Although it's not absolutely necessary to use a type library to use objects from an automation server, it's normally a very good idea. For one thing, without using the type library, you don't get the benefits of IntelliSense or the Object Browser when writing automation code. So, we recommend that you always use a type library. To use a type library for automation, you need to set a reference to the type library. Here's how to do that for the Microsoft Word and Microsoft Excel type libraries that you use in this chapter:
After you've added a reference to a type library, you'll find that type library's objects in the Object Browser. Press F2 to open the Object Browser, and then choose the type library you want to inspect from the Project/Library combo box. Figure 21.2 shows some of the objects in the Excel type library. You can see that these objects deal with such things as cells and charts, even though you're inspecting the type library from within an Access database. Figure 21.2. Using Object Browser to inspect a type library.![]() NOTE There's nothing really different about using the Object Browser on Access itself; it's still looking at a type library. The only difference is that Access automatically sets a reference to its own type library. |
< Day Day Up > |