Show AllShow All

TargetBrowser Property

Sets or returns an MsoTargetBrowser constant representing the target browser for documents viewed in a Web browser. Read/write.

expression.TargetBrowser

expression    Required. An expression that returns one of the objects in the Applies To list.

Remark

The TargetBrowser property sets the BrowserLevel property, but BrowserLevel is only important if the DisableFeatures property is set to True. Otherwise, it is ignored. The TargetBrowser property, however, is not ignored and sets the browser level for all Web documents or for a single Web document.

Example

This example sets the target browser for the active document to Microsoft Internet Explorer 6 if the current target browser is an earlier version.

Sub SetWebBrowser()
    With ActiveDocument.WebOptions
        If .TargetBrowser < msoTargetBrowserIE6 Then
            .TargetBrowser = msoTargetBrowserIE6
        End If
    End With
End Sub
		

This example sets the target browser for all documents to Internet Explorer 6.

Sub GlobalTargetBrowser()
    Application.DefaultWebOptions _
        .TargetBrowser = msoTargetBrowserIE6
End Sub
		
©2003 Microsoft Corporation. All rights reserved.