View Single Post
Old 06-06-2014, 08:10 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Word MVP 2003-2009
Join Date: May 2010
Location: Marble, NC
Posts: 1,033
gmaxey will become famous soon enoughgmaxey will become famous soon enough

Here is another variation. Not better just different:

Sub Demo()
Dim oRng As Word.Range
Dim i As Long, j As Long
Dim bFound As Boolean
  Application.ScreenUpdating = False
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Text = "<[A-Z][! ]@>"
    .Wrap = wdFindStop
    .MatchWildcards = True
    While .Execute
      bFound = True
      oRng.MoveEnd wdWord, 6
      For i = 2 To oRng.Words.Count
        If Not oRng.Words(i).Characters(1) Like "[A-Z]" Then bFound = False
      If bFound = True Then
        j = j + 1
        MsgBox oRng.Text
      End If
      oRng.Collapse wdCollapseEnd
  End With
  Application.ScreenUpdating = True
  MsgBox j & " instances found."
End Sub
Greg Maxey
Please visit my web site at
Reply With Quote