L
Lighthouse
I have a macro that searches my document and looks for a specific
marker that may or may not exist in the document. If it finds the
marker it is supposed to do some stuff from that marker to the end of
the document.
It works great (thanks to Dave Lett) when the marker is found, but I
need to tell it to stop if the marker is not found. This is what I
have:
With Selection
.HomeKey Unit:=wdStory
With .Find
.ClearFormatting
.Text = "marker"
.Style = "SuperHeading"
.Replacement.Text = ""
.Execute
End With
.MoveDown Unit:=wdParagraph, Count:=1
[do some stuff here]
what's happening is that if the marker is not found it does the [do
some stuff here] steps anyway. I need a way to quit the macro if my
..Text is not found.
Thanks.
marker that may or may not exist in the document. If it finds the
marker it is supposed to do some stuff from that marker to the end of
the document.
It works great (thanks to Dave Lett) when the marker is found, but I
need to tell it to stop if the marker is not found. This is what I
have:
With Selection
.HomeKey Unit:=wdStory
With .Find
.ClearFormatting
.Text = "marker"
.Style = "SuperHeading"
.Replacement.Text = ""
.Execute
End With
.MoveDown Unit:=wdParagraph, Count:=1
[do some stuff here]
what's happening is that if the marker is not found it does the [do
some stuff here] steps anyway. I need a way to quit the macro if my
..Text is not found.
Thanks.