G
Greg Maxey
Hi All,
Are Boolean's sticky? I cobbled togther this routine which is called from a
bigger macro that I am cobbling and it seemed sticky. After all
highlighting had been removed from a document the boolean fHight (a Private
declaration in the module) would still return True. I finally forced it to
be false at each time by adding
fHLight = False - immediately after the Call ResetFRParameters line.
is this how this need to be done?
Thanks
Sub TestForAnyHighlight()
Call ResetFRParameters
fHlight = False
With Selection
.HomeKey wdStory
.Find.ClearFormatting
.Find.Highlight = True
If .Find.Execute Then
.Collapse wdCollapseEnd
fHlight = True
End If
End With
End Sub
Are Boolean's sticky? I cobbled togther this routine which is called from a
bigger macro that I am cobbling and it seemed sticky. After all
highlighting had been removed from a document the boolean fHight (a Private
declaration in the module) would still return True. I finally forced it to
be false at each time by adding
fHLight = False - immediately after the Call ResetFRParameters line.
is this how this need to be done?
Thanks
Sub TestForAnyHighlight()
Call ResetFRParameters
fHlight = False
With Selection
.HomeKey wdStory
.Find.ClearFormatting
.Find.Highlight = True
If .Find.Execute Then
.Collapse wdCollapseEnd
fHlight = True
End If
End With
End Sub