View Single Post
 
Old 06-06-2014, 05:13 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,953
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The limitation relates to the complexity of wildcard expressions, not of the Find/Replace dialogue's capacity. Using a macro doesn't change that. That said, you could use a macro like:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long, j As Long, bFnd As Boolean
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "<[A-Z][! ]@> <[! ]@> <[! ]@> <[! ]@> <[! ]@> <[! ]@>"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchWildcards = True
    .Execute
  End With
  Do While .Find.Found
    bFnd = True
    For i = 1 To UBound(Split(.Text, " "))
      If Not Left(Split(.Text, " ")(i), 1) Like "[A-Z]" Then
        bFnd = False
        .End = .Duplicate.Words(i).End
        Exit For
      End If
    Next
    If bFnd = True Then
      j = j + 1
      MsgBox .Text
    End If
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
Application.ScreenUpdating = True
MsgBox j & " instances found."
End Sub
Basically, the macro looks for 5 space-separated words, the first of which begins with capitals. Having found them, it tests whether the remaining words all begin with capitals before continuing. As coded, you'll get a message box if a match is made.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote