Find/Replace problem

A

Andrea

I've got a long document that i use the find/replace to
find names in. after i find the name i close find, delete
the page, then control-f to open the find window again and
move onto the next name. (i use keyboard shortcuts and
page-delete macro to do all this) after doing this a few
times the note 'search down' appears. i know how to turn
it off but i want to know *why* it keeps changing on me
automatically. Can anyone help?
 
D

Doug Robbins

If it is the same name that you are looking for each time and you want to
delete all of the pages on which that name appears, the following macro will
ask you for the name and then do it all for you:

Dim findname As String, namepage As Range
findname = InputBox("Enter the Name that you are looking for.", "Page
Deleter")
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:=findname, Wrap:=wdFindContinue,
Forward:=True) = True
Set namepage = Selection.Range.Bookmarks("\page").Range
namepage.Delete
Loop
End With


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
K

Klaus Linke

Andrea,

And for "why": Word changes from searching "all" to "down" if you have
something selected before you start the search.

In that case, Word initially only searches the selection. When it has
finished, it'll ask you whether it should search the rest of the document.

BTW, nice keyboard shortcuts to find the next/previous occurrence without
opening the dialog again are Ctrl+PageDown ( = BrowseNext) and Ctrl+PageUp
(= BrowsePrevious).
The blue double arrows below the vertical scoll bar (to the right of the
document) serve the same purpose if you prefer the mouse.

Regards,
Klaus
 

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