Expand Minimize

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)

public Hyperlinks Hyperlinks { get; }

Property Value

Type: Microsoft.Office.Interop.Word.Hyperlinks
A Hyperlinks collection that represents all the hyperlinks in the document.

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