Inspectors 属性

       

返回 Inspectors 集合对象,该集合对象包含代表所有打开的检查器的 Inspector 对象。

expression.Inspectors

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

示例

本 Microsoft Visual Basic 示例使用 Inspectors 对象的 Inspectors 属性、Count 属性和 Item 方法来显示所有检查器窗口的标题。

Dim myOlApp As New Outlook.Application
Private Sub Command1_Click()
    If myOlApp.Inspectors.Count > 0 Then
        For x = 1 To myOlApp.Inspectors.Count
            MsgBox Inspectors.Item(x).Caption
        Next x
    Else
        MsgBox "There are no inspector windows open."
    End If
End Sub

    

如果使用 VBScript,则不必声明 Application 对象变量。本示例说明如何使用 VBScript 执行相同任务。

Private Sub Command1_Click()
    If Application.Inspectors.Count > 0 Then
        For x = 1 To myOlApp.Inspectors.Count
            MsgBox Inspectors.Item(x).Caption
        Next x
    Else
        MsgBox "There are no inspector windows open."
    End If
End Sub