Expand Minimize

DocumentBase.DefaultTargetFrame Property

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

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

public string DefaultTargetFrame { get; set; }

Property Value

Type: System.String
The browser frame in which to display a Web page reached through a hyperlink.

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

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);
}

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft