English 中文(简体)
C# PowerPoint 2007 management: .Hyperlink. 地址始终是NULL
原标题:C# PowerPoint 2007 management: .Hyperlink.Address always NULL

我有这个问题:

//someWord is a TextRange object from PPT TextBox
String address = someWord.ActionSettings[PpMouseActivation.ppMouseClick].Hyperlink.Address;

I m sure that this is the way to read address to webpages in a link, I was using this in PPT 2003, and it works! BUT, now I m trying to do the same in PPT 2007 and the .Hyperlink.Address is always equal to null.

任何建议? 谢谢!

问题回答

可能的话,《URL》会合在一起。 和你一样,还有一个案文箱来研究:

搜索引擎:Ask Jeeves

从技术上讲,有两条。 无论是在VBA中,还是看看其中一项还是两项(或无)工作:

Sub getHyperlinkfromTextRun()
    Dim sl As Slide: Set sl = ActivePresentation.Slides(2)
    Dim sh As Shape: Set sh = sl.Shapes(1)
    Dim tr As TextRange: Set tr = sh.TextFrame.TextRange
    Dim URL As String
    For i = 1 To tr.Runs.Count
        URL = tr.Runs(i).ActionSettings(ppMouseClick).Hyperlink.Address
        If Len(URL) > 0 Then
            Dim runText As String
            runText = tr.Runs(i).Text
            Debug.Print "RUN " & i & ": " & runText & ", " & "URL: " & URL
        End If
    Next
End Sub

Sub getHyperlinkfromTextRange()
    Dim sl As Slide: Set sl = ActivePresentation.Slides(2)
    Dim sh As Shape: Set sh = sl.Shapes(1)
    Dim tr As TextRange: Set tr = sh.TextFrame.TextRange
    Debug.Print tr.ActionSettings(ppMouseClick).Hyperlink.Address
End Sub




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签