![]() |
|
#2
|
||||
|
||||
|
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 Mac macro installation & usage instructions, see: http://word.mvps.org/Mac/InstallMacro.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Outlook leaves 2-3 unclosed tasks | Jennifer Murphy | Outlook | 0 | 08-24-2014 07:08 PM |
| Gray square brackets | waldux | Word | 8 | 09-25-2013 04:14 PM |
| Finding contents of brackets | return2300 | Word VBA | 0 | 09-04-2013 11:04 AM |
| brackets citation | uncung | Word | 1 | 07-13-2011 01:39 PM |
| Brackets Issue... | DarkJudge1 | Outlook | 0 | 07-06-2010 05:15 PM |