我需要从PowerPoint 2007中的文本运行中提取超链接。我知道我可以使用:TextFrame.TextRange.ActionSettings[PpMouseActivation.ppMouseClick].Hyperlink
但是,我的代码非常冗长,使用了TextFrame2及其对应的TextRange2,并且我在TextRange2中找不到ActionSettings。
有人知道它藏在哪里吗?
发布于 2010-06-28 14:33:47
是啊,这有点棘手。下面是如何获取所有这些内容的方法:
Sub GetLinks()
Dim p As Presentation
Set p = ActivePresentation
Dim s As Slide
Dim sh As Shape
For Each s In p.Slides
For Each sh In s.Shapes
Dim tr As TextRange
Set tr = sh.TextFrame.TextRange
For I = 1 To tr.Runs.count
link = tr.Runs(I).ActionSettings(ppMouseClick).Hyperlink.Address
If Len(link) > 0 Then
Debug.Print "Link: " & link
End If
Next
Next
Next
End Subhttps://stackoverflow.com/questions/3127041
复制相似问题