J
John
The following is called from another procedure. Its
purpose is to colour red everying enclosed by "{}" in a
Word document. Sometimes it works, sometimes it does not,
apparently at random. I can't see why.
Sub AllVariantsRed()
'
' AllVariantsRed Macro
' Macro recorded 27/10/03 by John
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Font.Color = wdColorRed
With Selection.Find
.text = "\{*\}"
.Replacement.text = ""
.Forward = True
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
I have tried reducing the size of the project in which
this procedure is included. I have tried reducing the
number of levels of procedures calling others. The
computer has plenty of memory.
A number of other procedures involving replace or search
are similarly unreliable.
Any suggestions?
purpose is to colour red everying enclosed by "{}" in a
Word document. Sometimes it works, sometimes it does not,
apparently at random. I can't see why.
Sub AllVariantsRed()
'
' AllVariantsRed Macro
' Macro recorded 27/10/03 by John
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Font.Color = wdColorRed
With Selection.Find
.text = "\{*\}"
.Replacement.text = ""
.Forward = True
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
I have tried reducing the size of the project in which
this procedure is included. I have tried reducing the
number of levels of procedures calling others. The
computer has plenty of memory.
A number of other procedures involving replace or search
are similarly unreliable.
Any suggestions?