Using the Object Browser

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The Object Browser is available in all Microsoft products that contain the VBA programming environment. The Object Browser allows you to view all objects, methods, properties, events, and constants of all COM components whose type libraries are referenced by the application you are working with. By default, each Office application references a set of type libraries. For example, Word references by default the Visual Basic for Applications, Microsoft Word 9.0, OLE Automation, and Microsoft Office 9.0 type libraries. To manually reference any additional type libraries available on your system, click References on the Tools menu in the Visual Basic Editor. For more information about setting references, see "Setting References and Working with Object Variables" later in this chapter.

To display the Object Browser, open the Visual Basic Editor, and then click Object Browser on the View menu. Figure 4.2 shows the Object Browser.

Figure 4.2 The Object Browser

The Project/Library box shows all the available referenced type libraries. These libraries allow you to use early binding with the corresponding applications.

The Search Text box shows any keywords you have searched for by using the drop-down list. You can also type a word in this box, and then click the Search button to search the available libraries for that word. The Search Results list displays any classes, properties, methods, events, or constants that contain the word you searched for.

The Classes list displays all objects and collections in the library, and the Members of list displays all methods, properties, events, and constants associated with the selected object in the Classes list. The bottom pane of the dialog box (the Details pane) displays other information about the currently selected item, such as what kind of object it is, its data type, what arguments it may take, and what library or collection it is a member of.

If a Help file has been associated with the objects in the type library, you can display a Help topic by clicking the item in either the Classes or Members of list, and then pressing F1 or clicking the Help button in the upper-right corner of the dialog box.