View Single Post
 
Old 05-28-2021, 04:38 AM
Matt C's Avatar
Matt C Matt C is offline Windows 10 Office 97-2003
Advanced Beginner
 
Join Date: May 2021
Location: London, UK
Posts: 30
Matt C is on a distinguished road
Default

UPDATE:

Sorry, I made some obvious minor errors with the above code. Here's my own tweaking which now works. However, it's a bit clunky as it repeats identical blocks of code to remove the "(" and ")" characters. Is there any way of slimming it down?

Quote:
Sub RemoveBracketsUPDATED()

Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Custom Style")
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Custom Style")
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

End Sub
Reply With Quote