Sub KillEndNoteFootNoteHyperLinks()
Dim SBar As Boolean ' Status Bar flag
Dim TrkStatus As Boolean ' Track Changes flag
Dim Rng1 As Range, Rng2 As Range, i As Long
' Store current Status Bar status, then switch on
SBar = Application.DisplayStatusBar
Application.DisplayStatusBar = True
' Store current Track Changes status, then switch off
With ActiveDocument
TrkStatus = .TrackRevisions
.TrackRevisions = False
End With
' Turn Off Screen Updating
Application.ScreenUpdating = False
With ActiveDocument
'Delete endnote/footnote hyperlinks from the MainStory
For i = .Hyperlinks.Count To 1 Step -1
With .Hyperlinks(i)
StatusBar = "Processing Hyperlink " & i
If .SubAddress Like "_ENum*" Then
.Range.Delete
ElseIf .SubAddress Like "_FNum*" Then
.Range.Delete
End If
End With
Next i
'Delete endnote hyperlinks from the EndnotesStory
If .Endnotes.Count > 0 Then
With .StoryRanges(wdEndnotesStory)
For i = .Hyperlinks.Count To 1 Step -1
StatusBar = "Processing Endnote Hyperlink " & i
With .Hyperlinks(i)
If .SubAddress Like "_ERef*" Then .Range.Delete
End With
Next i
End With
End If
'Delete footnote hyperlinks from the FootnotesStory
If .Footnotes.Count > 0 Then
With .StoryRanges(wdFootnotesStory)
For i = .Hyperlinks.Count To 1 Step -1
StatusBar = "Processing Footnote Hyperlink " & i
With .Hyperlinks(i)
If .SubAddress Like "_FRef*" Then .Range.Delete
End With
Next i
End With
End If
'Process all endnotes
For i = 1 To .Endnotes.Count
'Update the statusbar
StatusBar = "Processing Endnote " & i
'Define two ranges: one to the endnote reference the other to the endnote content
Set Rng1 = .Endnotes(i).Reference
Set Rng2 = .Endnotes(i).Range.Paragraphs.First.Range
'Format the endnote reference as visible text
Rng1.Font.Hidden = False
Rng2.Words.First.Font.Hidden = False
Next
'Process all footnotes
For i = 1 To .Footnotes.Count
'Update the statusbar
StatusBar = "Processing Footnote " & i
'Define two ranges: one to the footnote reference the other to the footnote content
Set Rng1 = .Footnotes(i).Reference
Set Rng2 = .Footnotes(i).Range.Paragraphs.First.Range
'Format the footnote reference as visible text
Rng1.Font.Hidden = False
Rng2.Words.First.Font.Hidden = False
Next
'Update the statusbar
StatusBar = "Finished Processing " & .Endnotes.Count & " Endnotes" & .Footnotes.Count & " Footnotes"
End With
Set Rng1 = Nothing: Set Rng2 = Nothing
' Restore original Status Bar status
Application.DisplayStatusBar = SBar
' Restore original Track Changes status
ActiveDocument.TrackRevisions = TrkStatus
' Restore Screen Updating
Application.ScreenUpdating = True
End Sub