Thanks,
is it possible to use Find to do this ?
is Find capable to find multiple words at once ?
> Hi Sos00,
>
[quoted text clipped - 23 lines]
> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)
Helmut Weber - 02 Jan 2006 10:21 GMT
Hi,
you may create your own find and highlight code.
Still, all find action is serial, in a way, as there is
no straightforward search doing all at once.
Have a look at this simple example:
Sub MyFind()
Dim l As Long
Dim rDcm As Range
Dim sTmp() As String
sTmp = Split(InputBox("Myfind"), " ")
For l = 0 To UBound(sTmp)
Set rDcm = ActiveDocument.Range
With rDcm.Find
.Text = sTmp(l)
While .Execute
rDcm.HighlightColorIndex = wdYellow
Wend
End With
Next
End Sub
Note that the delimiter is " ".
You may add all kinds of features you can think of.
In the inputbox, type something like: "brown fox jumps",
without the quotation marks.
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
Cindy M -WordMVP- - 02 Jan 2006 11:16 GMT
Hi Sos00,
> is it possible to use Find to do this ?
> is Find capable to find multiple words at once ?
Not if they're not contiguous. Again, the user interface
supports this, but the object model does not.
The way you have things lined up in your original
question... Could this be in a table? You can select a
table column.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)
sos00 - 03 Jan 2006 06:18 GMT
Thanks...
> You can select a table column.
you mean selecting multiple columns or rows in a table ?
> Hi Sos00,
>
[quoted text clipped - 17 lines]
> follow question or reply in the newsgroup and not by e-mail
> :-)
Doug Robbins - Word MVP - 03 Jan 2006 10:26 GMT
In your original post, the assumption was that Word1 and Word2 might be in
cells in the same column in a table.
You can select multiple contiguous rows or columns in a table, but there is
no way using vba to select anything that is NOT contiguous.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Thanks...
>
[quoted text clipped - 23 lines]
>> follow question or reply in the newsgroup and not by e-mail
>> :-)