区域。超链接属性 (Word)Range.Hyperlinks property (Word)
返回一个代表指定区域中的所有超链接的超链接集合。Returns a Hyperlinks collection that represents all the hyperlinks in the specified range. 此为只读属性。Read-only.
语法Syntax
表达式。超链接expression.Hyperlinks
expression 一个表示 Range 对象的变量。expression A variable that represents a Range object.
备注Remarks
有关返回集合中单个成员的信息, 请参阅返回集合中的对象。For information about returning a single member of a collection, see Returning an object from a collection.
示例Example
以下示例显示活动文档中前十个段落中的每个超链接的名称。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, _
Paragraphs(10).Range.End)
For Each objLink In objRange.Hyperlinks
If InStr(LCase(objLink.Address), "microsoft") <> 0 Then
MsgBox objLink.Name
End If
Next objLink
另请参阅See also
支持和反馈Support and feedback
有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.