Range.Hyperlinks Property (Word)
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

Range.Hyperlinks Property (Word)

Returns a Hyperlinks collection that represents all the hyperlinks in the specified range. Read-only.

expression .Hyperlinks

expression A variable that represents a Range object.

For information about returning a single member of a collection, see Returning an Object from a Collection.

This example displays the name of every hyperlink in the first ten paragraphs in the active document.

Dim objLink As Hyperlink 
Dim objRange As Range 
Set objRange = ActiveDocument.Range( _ 
 Paragraphs(1).Range.Start, _ 
For Each objLink In objRange.Hyperlinks 
 If InStr(LCase(objLink.Address), "microsoft") <> 0 Then 
 MsgBox objLink.Name 
 End If 
Next objLink
© 2016 Microsoft