Class Explorers (Outlook VBA)
Contains a set of Explorer objects representing all explorers. To use a Explorers class variable it first needs to be instantiated, for example
Dim exps as Explorers
Set exps = Explorers
For Each
Here is an example of processing the Explorers items in a collection.
Dim exp As Explorer
For Each exp In Explorers
Next exp
Add
Creates a new instance of the explorer window.
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.
Add (Folder, DisplayMode)
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
Arguments
The following argument is required
Folder (Folder) - The Variant object to display in the explorer window when it is created.
Optional arguments
The following argument is optional
DisplayMode (OlFolderDisplayMode) - The display mode of the folder. Can be one of the OlFolderDisplayMode constants.
Possible return values are olFolderDisplayFolderOnly - Only the contents of the selected folder are displayed, olFolderDisplayNoNavigation - Folder contents are displayed but no navigation pane is shown, olFolderDisplayNormal - Folder is displayed with navigation pane on the left and folder contents on the right.
Class
Returns an OlObjectClass constant indicating the object's class. Here you can find possible values for
Dim oocsClass As OlObjectClass
oocsClass = Explorers.Class
Count
Returns a Long indicating the count of objects in the specified collection.
Dim lngCount As Long
lngCount = Explorers.Count
Item
Returns an Explorer object from the collection.
Item (Index)
Index: Either the index number of the object, or a value used to match the default property of an object in the collection.
Dim exp As Explorer
Set exp = Explorers(Index:=1)
Session
Returns the NameSpace object for the current session.
The Session property and the GetNamespace method can be used interchangeably to obtain the NameSpace object for the current session. Both members serve the same purpose. For example, the following statements do the same function: