You're right - sorry.
Code:
Function CountSpaces() As Integer
Dim doc As Document: Set doc = ActiveDocument
Dim rngFind As Range
On Error GoTo EndOfSub
Application.ScreenUpdating = False
Call ClearFind
If Selection.Type < 2 Then
Set rngFind = doc.Range
Else
Set rngFind = Selection.Range
End If
CountSpaces = 0
With rngFind
With .Find
.Text = "^32{2;}"
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
.Execute
End With
Do While .Find.Found
If Len(rngFind.Text) > CountSpaces Then _
CountSpaces = Len(rngFind.Text)
.End = .End + 1
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
EndOfSub:
End Function
NP