0

I have found many example scripts which should work e.g.

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

However when I try to run this on Powerpoint on Mac it gives me this:

Compile Error: Method or data member not found

Does this mean this functionality doesn't exist in Mac PPT VBA?

  • I don't have a Mac w/2016 handy, but considering that the code works perfectly in Windows PPT, even back to 2010, I'd guess that this is missing in the Mac PPT object model. – Steve Rindsberg May 30 '18 at 15:43
  • I see you've posted the same question on Microsoft's Answers forum. John Wilson's reply confirms my suspicion. You've run into one of the various features that Windows PPT supports, Mac PPT does not. I tried to find a few workarounds (eg setting the hyperlink's .Address and .Subaddress to blank) but those just revealed MORE bugs. – Steve Rindsberg May 31 '18 at 15:21

1 Answers1

0

John SR Wilson over on the Microsoft Answers Forum found a way to workaround this so I decided to post it back here in case anyone was wondering

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

All credit to John SR Wilson!