Section 9.16. Object Browser

9.16. Object Browser

It is easy to be overwhelmed by the number of objects and what they do. It's equally overwhelming when you realize the number of objects that might be available to your machine without your being aware of it.

Microsoft Office 97, 2000, and XP provide a powerful programming environment based on the Visual Basic for Applications language (similar to VBScript). Within this environment, there is an object browser, which allows you to browse objects installed on your system and investigate the methods and properties associated with them. You do not actually have to write any code to take advantage of the Object Browser.

If you aren't familiar with the Visual Basic Environment, the Object Browser can be a little intimidating. See Learning Word Programming or Writing Excel Macros , both by Steve Roman (O'Reilly), for an introduction.


From either Microsoft Word or Excel:

  1. Select Tools Macro Visual Basic Editor. This will start the VBA environment.

  2. Select Tools References. The dialog box shown in Figure 9-2 will appear.

Figure 9-2. Object References dialog box

Select the library references you wish to use. The reference name for the WSH Wscript object is Microsoft Windows Script Host Object Model, and the FileSystem object is Microsoft Scripting Runtime.

Once you have selected the libraries you wish to reference, select the OK button.

Now press the F2 key. This will display the object browser window.

Select the object you wish to browse from the drop-down list in the upper left-hand corner. The Classes window on the left lists all objects related to the component, while the right window lists all methods and properties related to the selected object. Figure 9-3 shows the Object Browser viewing the FileSystem object.

Figure 9-3. Object Browser



Windows XP in a Nutshell
Windows XP in a Nutshell, Second Edition
ISBN: 0596009003
EAN: 2147483647
Year: 2003
Pages: 266

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net