Publisher) (TextRange.Hyperlinks 属性

返回一个 Hyperlinks 集合,该集合代表指定文字范围中的所有超链接。

语法

表达式。超链接

表达式 表示 TextRange 对象的变量。

返回值

Hyperlinks

示例

以下示例查找当前出版物的第一页上的所有包含文字框架的形状,并报告每个形状包含的超链接数量。

Dim hypAll As Hyperlinks 
Dim shpLoop As Shape 
 
For Each shpLoop In ActiveDocument.Pages(1).Shapes 
 If shpLoop.HasTextFrame = msoTrue Then 
 Set hypAll = shpLoop.TextFrame.TextRange.Hyperlinks 
 Debug.Print "Shape " & shpLoop.Name _ 
 & " has " & hypAll.Count & " hyperlinks." 
 End If 
Next shpLoop

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。