Document.DefaultTargetFrame Property (2007 System)
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.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public Property DefaultTargetFrame As String
'Usage
Dim instance As Document
Dim value As String
value = instance.DefaultTargetFrame
instance.DefaultTargetFrame = value
[BrowsableAttribute(false)]
public string DefaultTargetFrame { get; set; }
[BrowsableAttribute(false)]
public:
property String^ DefaultTargetFrame {
String^ get ();
void set (String^ value);
}
public function get DefaultTargetFrame () : String
public function set DefaultTargetFrame (value : String)
Property Value
Type: System.String
The browser frame in which to display a Web page reached through a hyperlink.
Remarks
The DefaultTargetFrame property has the following predefined strings: "_top", "_blank", "_parent", and "_self". It can also use any user-defined string.
Examples
The following code example sets Microsoft Office Word to open a new blank browser window when you click hyperlinks in the document.
This example is for a document-level customization.
Private Sub DocumentDefaultTargetFrame()
Me.DefaultTargetFrame = "_blank"
Dim address As Object = "https://www.msn.com/"
Me.Hyperlinks.Add(Me.Paragraphs(1).Range, address)
End Sub
private void DocumentDefaultTargetFrame()
{
this.DefaultTargetFrame = "_blank";
object address = "https://www.msn.com/";
this.Hyperlinks.Add(this.Paragraphs[1].Range, ref address, ref missing,
ref missing, ref missing,ref missing);
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.