代码之家  ›  专栏  ›  技术社区  ›  Arie Livshin

textrange2中的actionsettings在哪里?

  •  0
  • Arie Livshin  · 技术社区  · 16 年前

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

    但是,我的代码相当长,它使用 TextFrame2 以及相应的 TextRange2 ,我找不到 ActionSettings 在里面 特朗格雷2 .

    有人知道它藏在哪里吗?

    1 回复  |  直到 15 年前
        1
  •  0
  •   Todd Main    16 年前

    是啊,有点棘手。以下是如何获取所有这些信息:

    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
    
    推荐文章