Understanding the Explorer and Inspector Objects

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 Explorer object represents what you would recognize as the Microsoft® Outlook® user interface. For example, when you open Outlook, you are working in the Outlook Explorer object. A window that contains a specific Outlook item, such as a mail message or a contact, is an Outlook Inspector object.

You can open these objects programmatically and display items for the user. You can also use the ActiveExplorer and ActiveInspector methods of the Application object to return a programmatic reference to the Explorer or Inspector object that the user is currently working with.

If you want to use Microsoft® Visual Basic® for Applications (VBA) to add, remove, or manipulate command bars in Outlook, you start with a reference to the Explorer or Inspector object that contains the command bar you want to use and then use the object's CommandBars property to return a reference to the object's CommandBars collection. For example, the following code illustrates how to get a reference to the CommandBars collection for the active Explorer object:

Dim cbrExplorerBars As CommandBars
Set cbrExplorerBars = ActiveExplorer.CommandBars

Note   You can use the GetExplorerInfo and GetInspectorInfo procedures to see sample code that uses the Explorer and Inspector objects to get information about what is displayed in the active Outlook Explorer and Inspector objects, including information about built-in and custom command bars. The following figure illustrates the kind of information you can get from an Explorer object.

Information Returned by the GetExplorerInfo Procedure

Aa141351.00503(en-us,office.10).gif

See Also

Working with Microsoft Outlook Objects | Understanding the Application and NameSpace Objects | Working with Outlook Folders and Items | Understanding VBA in Outlook | Understanding Events in Outlook