Hi Andrew, that is an excellent idea of looking for the duplication instances after the code has run. The below looks for instances of ;]; or .]. and removes the duplicate punctuation after the square bracket to be ;] or .] - this works well but only if the square bracket is not within a text form field. I'm not sure what to add to the code to look for if the square bracket is within a text form field.
Code:
Sub RemovePuncDemo1()
Dim oRng As Range
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchWildcards = True
.text = "([;.])([\]])([;.])"
.Replacement.text = "\1\2"
.Execute Replace:=wdReplaceAll
End With
End Sub
Capture.JPG