首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >动作设置在TextRange2中的什么位置?

动作设置在TextRange2中的什么位置?
EN

Stack Overflow用户
提问于 2010-06-27 18:08:01
回答 1查看 524关注 0票数 0

我需要从PowerPoint 2007中的文本运行中提取超链接。我知道我可以使用:TextFrame.TextRange.ActionSettings[PpMouseActivation.ppMouseClick].Hyperlink

但是,我的代码非常冗长,使用了TextFrame2及其对应的TextRange2,并且我在TextRange2中找不到ActionSettings

有人知道它藏在哪里吗?

EN

回答 1

Stack Overflow用户

发布于 2010-06-28 14:33:47

是啊,这有点棘手。下面是如何获取所有这些内容的方法:

代码语言:javascript
复制
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 Sub
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3127041

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档