GetExplorer Method

Microsoft Outlook Visual Basic

GetExplorer Method

       

Returns an Explorer object that represents a new, inactive Explorer object initialized with the specified folder as the current folder. This method is useful for returning a new Explorer object in which to display the folder, as opposed to using the ActiveExplorer method and setting the CurrentFolder property.

The Display method can be used to activate or show the Explorer.

The GetExplorer method takes an optional argument of an OlFolderDisplayMode constant.

By default, the new Explorer will be displayed in the Normal mode (olFolderDisplayNormal) with all interface elements displayed: a message panel on the right, an Outlook bar on the left, and a folder banner across the top from which the user can pull down a folder navigation panel. The exception to this rule is when you are calling GetExplorer on delegated folders which are in No-Navigation mode by default. You can apply more restrictions to a default mode, but you cannot lessen the restrictions by changing the OlFolderDisplayMode.

The explorer can also be displayed in Folder-Only mode (olFolderDisplayFolderOnly) in which the Explorer will display with no folder list and no Outlook bar, but the drop-down list and the navigation commands will still be available.

The most restrictive mode you can use is No-Navigation mode (olFolderDisplayNoNavigation). In this mode, the Explorer will display with no folder list, no drop-down folder list, and any "Go"-type menu/command bar options should be disabled. Basically, the user should not be able to navigate to any other folder within that Explorer window. By default, a delegated (shared) folder appears in No-Navigation mode.

expression.GetExplorer(DisplayMode)

expression   Required. An expression that returns a MAPIFolder object.

DisplayMode   Optional Variant. The display mode of the folder. Can be one of the following OlFolderDisplayMode constants: olFolderDisplayFolderOnly, olFolderDisplayNoNavigation or olFolderDisplayNormal (default).

Example

This Visual Basic for Applications example uses the GetExplorer method to return a new, inactive Explorer for myFolder, and then displays it in the default mode of olFolderDisplayNormal.

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNameSpace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
Set myExplorer = myFolder.GetExplorer
myExplorer.Display

If you use VBScript, you do not create the Application object, and you cannot use named constants. This example shows how to perform the same task using VBScript.

Set myNameSpace = Application.GetNameSpace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(6)
Set myExplorer = myFolder.GetExplorer
myExplorer.Display