D
Diane R
Hi all,
I am creating a macro that has to find occurences of a
string and hide the text. The macro works great - in
Word 2002. When I try to run it on a Word 2000 machine,
it invariably locks the program up (almost like it's
caught in a continuous loop). The code is pasted below.
Any help would be appreciated.
Thanks bunches, ya'll,
Diane
*****************
' Find ++SIG-- and hide
' Written by Diane 4/1/04
Selection.WholeStory
Selection.HomeKey Unit:=wdStory
'execute the find for ++SIG--
Selection.Find.ClearFormatting
With Selection.Find
.Forward = True
.ClearFormatting
.MatchWholeWord = True
.MatchCase = False
.Wrap = wdFindContinue
.Execute findtext:="++SIG--"
Do While .Found = True
If Selection.Font.Hidden = False Then
With Selection.Font
.Hidden = True
End With
End If
.Wrap = wdFindContinue
.Execute findtext:="++SIG--"
Loop
End With
I am creating a macro that has to find occurences of a
string and hide the text. The macro works great - in
Word 2002. When I try to run it on a Word 2000 machine,
it invariably locks the program up (almost like it's
caught in a continuous loop). The code is pasted below.
Any help would be appreciated.
Thanks bunches, ya'll,
Diane
*****************
' Find ++SIG-- and hide
' Written by Diane 4/1/04
Selection.WholeStory
Selection.HomeKey Unit:=wdStory
'execute the find for ++SIG--
Selection.Find.ClearFormatting
With Selection.Find
.Forward = True
.ClearFormatting
.MatchWholeWord = True
.MatchCase = False
.Wrap = wdFindContinue
.Execute findtext:="++SIG--"
Do While .Found = True
If Selection.Font.Hidden = False Then
With Selection.Font
.Hidden = True
End With
End If
.Wrap = wdFindContinue
.Execute findtext:="++SIG--"
Loop
End With