Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Document.Hyperlinks Property

Office 2007
Returns a Hyperlinks collection that represents all the hyperlinks in the specified document. Read-only.

Syntax

expression.Hyperlinks

expression   A variable that represents a Document object.

Remarks

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

Example

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

Visual Basic for Applications
If Documents("Home.doc").Hyperlinks.Count >= 2 Then
    MsgBox Documents("Home.doc").Hyperlinks(2).Name
End If

This example displays the name of every hyperlink in the active document that includes the word "Microsoft" in its address.

Visual Basic for Applications
For Each aHyperlink In ActiveDocument.Hyperlinks
    If InStr(LCase(aHyperlink.Address), "microsoft") <> 0 Then
        MsgBox aHyperlink.Name
    End If
Next aHyperlink



Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.