返回代表指定文档、区域或所选内容中的所有超链接的 Hyperlinks 集合。只读。
有关返回集合中单个成员的内容,请参阅返回集合中的对象。
本示例显示 Home.doc 中第二个超链接的目标地址。
If Documents("Home.doc").Hyperlinks.Count >= 2 Then
MsgBox Documents("Home.doc").Hyperlinks(2).Name
End If
本示例跳至选定部分第一个超链接的地址。
If Selection.Hyperlinks.Count >= 1 Then
Selection.Hyperlinks(1).Follow
End If
本示例显示活动文档中在地址中含有单词“Microsoft”的超链接的名字。
For Each aHyperlink In ActiveDocument.Hyperlinks
If InStr(LCase(aHyperlink.Address), "microsoft") <> 0 Then
MsgBox aHyperlink.Name
End If
Next aHyperlink