With the code I posted, change the With wdDoc … End With block to:
Code:
With wdDoc
.ActiveWindow.View.ShowFieldCodes = True
With .Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "()"
.Replacement.Text = ""
.Forward = True
.Format = False
.Wrap = wdFindContinue
.MatchWildcards = False
.Execute Replace:=wdReplaceAll
.Text = "(^d HYPERLINK"
.Wrap = wdFindStop
.Execute
End With
Do While .Find.Found = True
.MoveEndUntil ")", wdForward
.End = .End + 1
.Delete
.Collapse wdcollpaseend
.Find.Execute
Loop
End With
.ActiveWindow.View.ShowFieldCodes = False
.Close SaveChanges:=True
End With