A
automandc
I have a procedure that eliminates all extra spaces (i.e., more than 2 in a
row) from the document. However, there is one particular style which has a
mono type, and spaces are used to line things up. I want my routine to
search the document and ignore only the paragraphs formatted in that style.
Here is the routine, and a representation of what I want to do (but which
doesn't work):
Sub DeleteExtraSpaces()
'
' Replaces any instance of 3 or more spaces with 2 spaces only.
'
If Not TrackChanges Then
With ActiveDocument.Content.Find
.ClearFormatting
.Replacement.ClearFormatting
.Font.Underline = wdUnderlineNone
.Style <> "BriefXScript" ' This is what I want to do, but get an
error.
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
.Execute FindText:=" {3,}", ReplaceWith:=" ", Replace:=wdReplaceAll
.ClearFormatting
End With
End If
End Sub
Thanks in advance!
row) from the document. However, there is one particular style which has a
mono type, and spaces are used to line things up. I want my routine to
search the document and ignore only the paragraphs formatted in that style.
Here is the routine, and a representation of what I want to do (but which
doesn't work):
Sub DeleteExtraSpaces()
'
' Replaces any instance of 3 or more spaces with 2 spaces only.
'
If Not TrackChanges Then
With ActiveDocument.Content.Find
.ClearFormatting
.Replacement.ClearFormatting
.Font.Underline = wdUnderlineNone
.Style <> "BriefXScript" ' This is what I want to do, but get an
error.
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
.Execute FindText:=" {3,}", ReplaceWith:=" ", Replace:=wdReplaceAll
.ClearFormatting
End With
End If
End Sub
Thanks in advance!