ActiveExplorer Method

Microsoft Outlook Visual Basic

ActiveExplorer Method

       

Returns the topmost Explorer object on the desktop. If no explorer is active, returns Nothing. Use this method to return the Explorer object that the user is most likely viewing. This method is also useful for determining when there is no active explorer, so a new one can be opened.

expression.ActiveExplorer

expression   Required. An expression that returns an Application object.

Example

This Visual Basic for Applications example uses ActiveExplorer to demonstrate how to obtain an Explorer object for use, preferably getting the user's active explorer, but creating a new one for myFolder if there isn't already one on the desktop.

Set myOlApp = CreateObject("Outlook.Application")
Set myExplorer = myOlApp.ActiveExplorer
If TypeName(myExplorer) = "Nothing" Then
    Set myExplorer = myFolder.GetExplorer
End If