You could do that with a series of
wildcard Find operations, where:
Find = \([!\)]@^13
to find opening parentheses that lack closing ones;
Find = ^13[!\(]@\)
to find closing parentheses that lack opening ones;
Find = \[[!\]]@^13
to find opening square brackets that lack closing ones; and
Find = ^13[!\[]@\]
to find closing square brackets that lack opening ones.
Alternatively, you could use a macro like:
Code:
Sub Demo()
Dim oPara As Paragraph
For Each oPara In ActiveDocument.Paragraphs
With oPara.Range
If Len(Replace(.Text, "(", vbNullString)) <> Len(Replace(.Text, ")", vbNullString)) Then
.Select
MsgBox "Selected paragraph has unmatched smart parentheses", vbExclamation
Exit Sub
ElseIf Len(Replace(.Text, "[", vbNullString)) <> Len(Replace(.Text, "]", vbNullString)) Then
.Select
MsgBox "Selected paragraph has unmatched smart square brackets", vbExclamation
Exit Sub
End If
End With
Next
End Sub
For PC macro installation & usage instructions, see:
http://www.gmayor.com/installing_macro.htm
For Mac macro installation & usage instructions, see:
http://word.mvps.org/Mac/InstallMacro.html