无法删除PPT2016中带VBA的超链接(MAC OS)

Can't delete hyperlinks with VBA in PPT2016 (MAC OS)

我发现了很多示例脚本应该可以工作,例如

Sub DeleteLinks()
    Dim oSl As Slide
    Dim x As Long

    For Each oSl In ActivePresentation.Slides
        For x = oSl.Hyperlinks.Count To 1 Step -1
            oSl.Hyperlinks(x).Delete
        Next
    Next

End Sub

然而,当我尝试在 Mac 上的 Powerpoint 上 运行 这个时,它给了我这个:

编译错误:未找到方法或数据成员

这是否意味着 Mac PPT VBA 中不存在此功能?

Microsoft Answers Forum 上的 John SR Wilson 找到了解决此问题的方法,因此我决定 post 将其放回此处以防有人疑惑

See if this works on your Mac

Sub killMacLinks()
Dim ohl As Hyperlink
Dim osld As Slide
Dim asT As ActionSetting
Set osld = ActiveWindow.Selection.SlideRange(1)
For Each ohl In osld.Hyperlinks
Set asT = ohl.Parent
asT.Action = ppActionNone
Next
End Sub

If it works you can easily loop through all slides.
www.pptalchemy.co.uk

所有功劳归功于 John SR Wilson!