Search up (or down) ONLY

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
 
J

Jay Freedman

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top