Hyperlinks Property

Applies To

Document object, Range object, Selection object.

Description

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

See Also

Add method (Hyperlinks collection), FollowHyperlink method.

Example

This example displays the target address of the second hyperlink in Home.doc.

If Documents("Home.doc").Hyperlinks.Count >= 2 Then
    MsgBox Documents("Home.doc").Hyperlinks(2).Name
End If
This example jumps to the address of the first hyperlink in the selection.

If Selection.Hyperlinks.Count >= 1 Then
    Selection.Hyperlinks(1).Follow
End If
This example displays the name of every hyperlink in the active document that includes the word "Microsoft" in its address.

For Each aHyperlink In ActiveDocument.Hyperlinks
    If InStr(LCase(aHyperlink.Address), "Microsoft") <> 0 Then
        MsgBox aHyperlink.Name
    End If
Next aHyperlink