Shortcut for find next occurence in Word?

G

Guest

I would like to be able to double click on a word in Word, which highlites
it, and run a macro that finds the next occurence of that word in the
document. I would assign the macro to a toolbar button and/or give it a
keyboard command.

With no macro the best way I know to accomplish this is : Edit>find>type in
the desired word>find next

With the macro I've described above it is double click, single click. Much
easier.

Anyone know how to write that macro? (The prt I don't know hoe to do is
automatically pasting the highlited text into the find field.) Ideally,
running the macro would take you directly to the next occurence in the
document - with no dialogue box to navigate.

Anybody?
 
G

Graham Mayor

Assign the following macro to a toolbar button. Select your word and click
the button. It will step through the document with each click.

FindText = Selection
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = FindText
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
End With
Selection.Find.Execute

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Guest

Dear Graham Mayor,

You have made me very happy today! Thank you for your help. I will begin
using that tool immediately.
 

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