Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2005

Tip: Looking for answers? Try searching our database.

Search for specific words in a document using an external list?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Krazykaj - 30 Sep 2005 04:07 GMT
Hello,

I have a word document (for example, I’ll call it ‘Article.doc’) which is
rather large, containing certain news articles.

I wish to do a search/find and identify specific key words in ‘Article.doc’.
However, the list of possible words in ‘Article.doc’ that I wish to find (if
they are there), number about 500.

I have this list of words that I want to be found stored in a separate
document that is always being updated/changed. (For example, I’ll call this
document ‘List.doc’)

I do not want to have to go and use the Find Feature built-in to MS Word and
copy/paste all 500 words individually and search ‘Article.doc’ to see if they
are present.

So I was curious, is there a way I can get MS Word to take/store the list of
words in ‘List.doc’ and then go through ‘Article.doc’ and find any instances
of any of the words from the ‘List.doc’.
If possible I would like to also go one step further, and not only find
instances of any of the 500 words in the ‘Article.doc’, but to also highlight
them in yellow.

If you have any help or suggestions, I would greatly appreciate it :-D

Thankyou kindly for you time,

Kind Regards
KJ
Anand.V.V.N - 30 Sep 2005 05:06 GMT
Hi,

this is possible. I am not sure of the code, but I think this is what  you
have to do.
In the macro , open both the files

Start a loop i.e. a for loop which would pick out the words from the
list.doc word by word, you can store it in a variable in the second for loop
find the word usign the find.execute, if  the text is found, you can I guess
there is a way to highlight.

In the list.doc the words are stored one word per line or they stored as
comma sperated. If it is one word per sentence, the loop would simple, but if
it is a comm septated file, I guess you would have to check for comma.

Hope you found this helpful
Anand
Signature

"Who will guard the guards?"

> Hello,
>
[quoted text clipped - 26 lines]
> Kind Regards
> KJ
Krazykaj - 30 Sep 2005 05:14 GMT
Hello,

Thankyou for the response :-D

I will have a go at what you suggest,
One thing that i may mention though is that i just came accross this thread
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.
public.word.vba.general&mid=9472d73a-65b2-4d07-8c65-83cdd7f789b2&sloc=en-us


So i will have a go at what is suggested there as well and see what happens
:-)

thankyou again,

Cheers
KJ

> Hi,
>
[quoted text clipped - 13 lines]
> Hope you found this helpful
> Anand
Anand.V.V.N - 01 Oct 2005 05:13 GMT
Hi,

I checked the thread too.
Looks promising, All the best, let me know what happened.

Anand

Signature

"Who will guard the guards?"

> Hello,
>
[quoted text clipped - 29 lines]
> > Hope you found this helpful
> > Anand
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.