Hyperlinks 集合对象

         
多个对象
Hyperlinks
Hyperlink

幻灯片或母版中所有 Hyperlink 对象的集合。

使用 Hyperlinks 集合

使用 Hyperlinks 属性返回 Hyperlinks 集合。以下示例更新当前演示文稿第一张幻灯片中所有指定地址的超链接。

For Each hl In ActivePresentation.Slides(1).Hyperlinks
    If hl.Address = "c:\current work\sales.ppt" Then
        hl.Address = "c:\new\newsales.ppt"
    End If
Next

使用 Hyperlink 属性创建一个超链接并将其添加到 Hyperlinks 集合中。以下示例设置一个超链接,当用户在幻灯片放映中单击当前演示文稿第一张幻灯片第三个形状时,该链接响应;本示例还将该超链接添加到集合中。请注意,以下示例中,如果第三个形状定义了一个单击鼠标的超链接,则在添加新超链接的同时会将此超链接从集合中删除,因此 Hyperlinks 集合中的项目数不变。

With ActivePresentation.Slides(1).Shapes(3) _
        .ActionSettings(ppMouseClick)
    .Action = ppActionHyperlink
    .Hyperlink.Address = "http://www.microsoft.com"
End With