DocumentBase.Hyperlinks Property

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

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

Syntax

'Declaration
Public ReadOnly Property Hyperlinks As Hyperlinks
public Hyperlinks Hyperlinks { get; }

Property Value

Type: Microsoft.Office.Interop.Word.Hyperlinks
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 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

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace