Search up (or down) ONLY

  • Thread starter Thread starter George M. Lutz
  • Start date Start date
G

George M. Lutz

Can I write a macro that searches a document from the insertion point up, only?

Your help is greatly appreciated.

George Lutz
 
George said:
Can I write a macro that searches a document from the insertion point
up, only?

Your help is greatly appreciated.

George Lutz

Hi George,

In the Selection.Find object in your macro, set .Forward = False and .Wrap =
wdFindStop. To search down instead, use .Forward = True.

If the selection might be extended (more than one character) when the macro
starts, you might want to insert the statement
Selection.Collapse wdCollapseEnd
before starting the search.
 
Back
Top