Freigeben über


DocumentBase.Hyperlinks Property

Definition

Gets a Hyperlinks collection that represents all the hyperlinks in the document.

public:
 property Microsoft::Office::Interop::Word::Hyperlinks ^ Hyperlinks { Microsoft::Office::Interop::Word::Hyperlinks ^ get(); };
public Microsoft.Office.Interop.Word.Hyperlinks Hyperlinks { get; }
member this.Hyperlinks : Microsoft.Office.Interop.Word.Hyperlinks
Public ReadOnly Property Hyperlinks As Hyperlinks

Property Value

A Hyperlinks collection that represents all the hyperlinks in the document.

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

Applies to