ActiveExplorer 方法

       

返回桌面上顶层的 Explorer 对象。如果没有活动的浏览器,则返回 Nothing。用此方法返回用户最可能查看的 Explorer 对象。此方法对于确定是否没有活动的浏览器(以便打开新的 Explorer 对象)也很有用。

expression.ActiveExplorer

expression   必选。该表达式返回 Application 对象。

示例

本 Visual Basic for Applications 示例使用 ActiveExplorer 演示如何获得要使用的 Explorer 对象。通常会得到用户的活动浏览器;但如果桌面上没有活动的浏览器,则为 myFolder 创建一个新的浏览器。

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