返回或设置一个 MsoTargetBrowser 常量,该常量指示浏览器的版本。可读写。
MsoTargetBrower 可为以下 MsoTargetBrower 常量之一。 |
msoTargetBrowserIE4 Microsoft Internet Explorer 4.0 或更高版本。 |
msoTargetBrowserIE5 Microsoft Internet Explorer 5.0 或更高版本。 |
msoTargetBrowserIE6 Microsoft Internet Explorer 6.0 或更高版本。 |
msoTargetBrowserV3 Microsoft Internet Explorer 3.0、Netscape Navigator 3.0 或更高版本。 |
msoTargetBrowserV4 Microsoft Internet Explorer 4.0、Netscape Navigator 4.0 或更高版本。 |
expression.TargetBrowser
expression 必需。该表达式返回“应用于”列表中的对象之一。
在本示例中,Microsoft Excel 确定 Web 选项的浏览器版本是否为 IE5,并通知用户。
Sub CheckWebOptions()
Dim wkbOne As Workbook
Set wkbOne = Application.Workbooks(1)
' Determine if IE5 is the target browser.
If wkbOne.WebOptions.TargetBrowser = msoTargetBrowserIE5 Then
MsgBox "The target browser is IE5 or later."
Else
MsgBox "The target browser is not IE5 or later."
End If
End Sub