Muokkaa

Jaa


Explorers.Add method (Outlook)

Creates a new instance of the explorer window.

Syntax

expression.Add (Folder, DisplayMode)

expression A variable that represents an Explorers object.

Parameters

Name Required/Optional Data type Description
Folder Required Variant The Variant object to display in the explorer window when it is created.
DisplayMode Optional Long The display mode of the folder. Can be one of the OlFolderDisplayMode constants.

Return value

An Explorer object that represents a new instance of the window.

Remarks

The Folder argument can represent either a Folder object or the URL to that folder.

The explorer window is initially hidden. You must call the Display method of the Explorer object to make it visible.

Example

The following VBA example displays the Drafts folder in an explorer window without a Navigation Pane or Folder List.

Sub DisplayDrafts() 
 
 Dim myExplorers As Outlook.Explorers 
 
 Dim myOlExpl As Outlook.Explorer 
 
 Dim myFolder As Outlook.Folder 
 
 
 
 Set myExplorers = Application.Explorers 
 
 Set myFolder = Application.GetNamespace("MAPI").GetDefaultFolder _ 
 
 (olFolderDrafts) 
 
 Set myOlExpl = myExplorers.Add _ 
 
 (myFolder, olFolderDisplayNoNavigation) 
 
 myOlExpl.Display 
 
End Sub

See also

Explorers Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.