How about this pseudo code...
With Selection.Find
.Text = "psychosis"
.Replacement.Text = ""
.Forward = True
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
While .Found
show myform
(select the choice from myform and execute it)
.Execute
Wend
End With
Eddie
> *From:* Clueless<Clueless@discussions.microsoft.com>
> *Date:* Tue, 27 Feb 2007 05:12:03 -0800
[quoted text clipped - 46 lines]
>
> any help is much appreciated!
Clueless - 27 Feb 2007 15:11 GMT
Thanks very much!
I wil try it
> How about this pseudo code...
>
[quoted text clipped - 68 lines]
> >
> > any help is much appreciated!
Clueless - 03 Mar 2007 16:11 GMT
Your pseudocode searches and finds perfectly!
(To further demonstrate my ignorance about the event driven nature of object
oriented programming...)
After I select the choice from myform, how do I get back into the do-while
loop to pick up where I left off?
Many thanks
> How about this pseudo code...
>
[quoted text clipped - 68 lines]
> >
> > any help is much appreciated!
Edward Thrashcort - 04 Mar 2007 12:05 GMT
I'm not quite sure why you are stepping out of the loop
Would it help to make the "deletion code" a function?
Sub MySelector()
With Selection.Find
.Text = "psychosis"
.Replacement.Text = ""
.Forward = True
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
While .Found
ChooseToDelete
.Execute
Wend
End With
End Sub
Function ChooseToDelete()
Show myform
'(select the choice from myform and execute it)
End Function
Eddie
Clueless - 05 Mar 2007 11:09 GMT
Your function solution worked perfectly! Thank you.
I hope this will be my last question:
I repeat this block of code with different words
As Selection.Find steps through each occurrence of a word sometimes the
document recenters itself on the newly detected word and sometimes not.
Is there a way I can force WORD to recenter or focus on the word that has
just been found?
Many thanks for your help!!
> I'm not quite sure why you are stepping out of the loop
> Would it help to make the "deletion code" a function?
[quoted text clipped - 26 lines]
>
> Eddie
Edward Thrashcort - 06 Mar 2007 00:21 GMT
> sometimes the document recenters itself on the newly detected word
> and sometimes not
It's the "sometimes not" that you need to focus on. Try stepping through
your code when it reaches a "not" incident and see what's going on.
I can't possibly help you because I frankly can't imagine what the problem
might be.
Eddie
> *From:* Clueless<Clueless@discussions.microsoft.com>
> *Date:* Mon, 5 Mar 2007 03:09:10 -0800
[quoted text clipped - 41 lines]
> >
> > Eddie
Clueless - 06 Mar 2007 17:31 GMT
Thanks sincerely for all your help
I will proceed as you have suggested
Cheers
> > sometimes the document recenters itself on the newly detected word
> > and sometimes not
[quoted text clipped - 52 lines]
> > >
> > > Eddie