Compartilhar via


DocumentBase.DefaultTargetFrame Property

Definition

Gets or sets the browser frame in which to display a Web page reached through a hyperlink.

public:
 property System::String ^ DefaultTargetFrame { System::String ^ get(); void set(System::String ^ value); };
public string DefaultTargetFrame { get; set; }
member this.DefaultTargetFrame : string with get, set
Public Property DefaultTargetFrame As String

Property Value

The browser frame in which to display a Web page reached through a hyperlink.

Examples

The following code example sets Microsoft Office Word to open a new blank browser window when you click hyperlinks in the document. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentDefaultTargetFrame()
{
    this.DefaultTargetFrame = "_blank";
    object address = "http://www.msn.com/";
    this.Hyperlinks.Add(this.Paragraphs[1].Range, ref address, ref missing, 
        ref missing, ref missing,ref missing);
}
Private Sub DocumentDefaultTargetFrame()
    Me.DefaultTargetFrame = "_blank"
    Dim address As Object = "http://www.msn.com/"
    Me.Hyperlinks.Add(Me.Paragraphs(1).Range, address)
End Sub

Remarks

The DefaultTargetFrame property has the following predefined strings: "_top", "_blank", "_parent", and "_self". It can also use any user-defined string.

Applies to