View Single Post
 
Old 01-08-2023, 06:17 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,163
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

This code works if your hyperlinks are all at the Shape Level. It might be a problem if you have sub-shapes with hyperlinks.
Code:
Sub RemoveHLs()
  Dim aPage As Page, aShape As Shape, i As Integer
  For Each aPage In ActiveDocument.Pages
    For Each aShape In aPage.Shapes
      Do While aShape.Hyperlinks.Count > 0
        aShape.Hyperlinks(0).Delete 'apparently hyperlinks are a zero-based array
      Loop
    Next aShape
  Next aPage
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote