How do I turn select text on and use Find to select a block of te.

G

Guest

In old parlance I want to turn on a block (select text) and block to where
Find stops.
For example, in a macro I find a point, start select text and go to the
point where a key word appears, then delete the block.
 
J

Jay Freedman

In old parlance I want to turn on a block (select text) and block to where
Find stops.
For example, in a macro I find a point, start select text and go to the
point where a key word appears, then delete the block.

In Word, "block select mode" is called Extend mode. You turn it on and
off by pressing F8 or double-clicking the letters EXT in the status
bar.

You can turn Extend mode on, then use the Find dialog to find the key
word. When it's found, you can close the dialog and press the Delete
key. You'll have to turn off Extend mode explicitly.

To do it with a macro, try this:

Sub BlockFindDelete()
Selection.ExtendMode = True
Dialogs(wdDialogEditFind).Show
Selection.Delete
Selection.ExtendMode = False
End Sub
 

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