View Single Post
 
Old 06-09-2025, 11:39 PM
gcp gcp is offline Windows 11 Office 2021
Novice
 
Join Date: Mar 2025
Posts: 17
gcp is on a distinguished road
Default

The macro also removes brackets and contents that are not superscripted. What have I done wrong?

Code:
Sub RemoveFootnotes()
Application.ScreenUpdating = False
    ActiveDocument.Fields.Unlink ' I think this removes hyperlinks
With ActiveDocument.Range.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Font.Superscript = True
  .Execute FindText:="[\(\[]*[\)\]]", ReplaceWith:="", MatchWildcards:=True, Format:=False, Forward:=True, Wrap:=wdFindContinue, Replace:=wdReplaceAll
End With

Application.ScreenUpdating = True
End Sub

Last edited by macropod; 06-10-2025 at 12:09 AM. Reason: Added code tags for code formatting
Reply With Quote