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

K

Krazykaj

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
 
A

Anand.V.V.N

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
 
A

Anand.V.V.N

Hi,

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

Anand
 

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