Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
MolTom
 
Posts: n/a
Default How to find a series of words and then changing formats

I have a large Word document in which I would like to 1) find out if the
document contains specific words, which I have listed in a separate document
and 2) highlight by bold or underline any occurence of the select words in
the document.

Is there a way for me to do this automatically. I would like to easily
identify the incidence of the select words in the document without having to
read and highlight the document, as I know that I will miss many incidences
of the words.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Richard O. Neville
 
Posts: n/a
Default How to find a series of words and then changing formats

You can do this with the Replace function. Let's suppose you want to
highlight all occurrences of the word "document." Type that word into the
"Find what" box. Type it again in the "Replace with" box, but this time
click More. Select Format-highlight (or underline--use Format-font), then
click Find next. Try it on two or three replacements; if OK, click Replace
all. You can do the same for strings of words. You may be better off using
underline unless you have color printers to show the highlighting.

You may have to use "whole words only" because the plural, documents, would
otherwise not have the terminal "s" highlighted or underlined. Same would be
true of documentation, documented, etc. This is not a problem with strings,
if, for instance, you wanted to select "the contract document." You may also
have to watch for capitalized "Document," which could start a sentence.

"MolTom" wrote in message
...
I have a large Word document in which I would like to 1) find out if the
document contains specific words, which I have listed in a separate
document
and 2) highlight by bold or underline any occurence of the select words in
the document.

Is there a way for me to do this automatically. I would like to easily
identify the incidence of the select words in the document without having
to
read and highlight the document, as I know that I will miss many
incidences
of the words.



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
MolTom
 
Posts: n/a
Default How to find a series of words and then changing formats

Richard, Thank you for your response! I have though about 100 unique words
that I am looking for. Is there a way that I could find-replace any
incidence of the words at one time. Or am I stuck doing find-replace ~100
times for all the words that I am looking for.

Thanks again!! I welcome your continued advice and help!!


"Richard O. Neville" wrote:

You can do this with the Replace function. Let's suppose you want to
highlight all occurrences of the word "document." Type that word into the
"Find what" box. Type it again in the "Replace with" box, but this time
click More. Select Format-highlight (or underline--use Format-font), then
click Find next. Try it on two or three replacements; if OK, click Replace
all. You can do the same for strings of words. You may be better off using
underline unless you have color printers to show the highlighting.

You may have to use "whole words only" because the plural, documents, would
otherwise not have the terminal "s" highlighted or underlined. Same would be
true of documentation, documented, etc. This is not a problem with strings,
if, for instance, you wanted to select "the contract document." You may also
have to watch for capitalized "Document," which could start a sentence.

"MolTom" wrote in message
...
I have a large Word document in which I would like to 1) find out if the
document contains specific words, which I have listed in a separate
document
and 2) highlight by bold or underline any occurence of the select words in
the document.

Is there a way for me to do this automatically. I would like to easily
identify the incidence of the select words in the document without having
to
read and highlight the document, as I know that I will miss many
incidences
of the words.




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Richard O. Neville
 
Posts: n/a
Default How to find a series of words and then changing formats

You are stuck doing it 100 times, because the Replace function can handle
only one word or string at a time. In other words, you can't "replace" the
words "document," "page," or "line" all at once unless they are in a string,
such as "on the first line of every page in this document..."

"MolTom" wrote in message
...
Richard, Thank you for your response! I have though about 100 unique words
that I am looking for. Is there a way that I could find-replace any
incidence of the words at one time. Or am I stuck doing find-replace ~100
times for all the words that I am looking for.

Thanks again!! I welcome your continued advice and help!!


"Richard O. Neville" wrote:

You can do this with the Replace function. Let's suppose you want to
highlight all occurrences of the word "document." Type that word into the
"Find what" box. Type it again in the "Replace with" box, but this time
click More. Select Format-highlight (or underline--use Format-font), then
click Find next. Try it on two or three replacements; if OK, click
Replace
all. You can do the same for strings of words. You may be better off
using
underline unless you have color printers to show the highlighting.

You may have to use "whole words only" because the plural, documents,
would
otherwise not have the terminal "s" highlighted or underlined. Same would
be
true of documentation, documented, etc. This is not a problem with
strings,
if, for instance, you wanted to select "the contract document." You may
also
have to watch for capitalized "Document," which could start a sentence.

"MolTom" wrote in message
...
I have a large Word document in which I would like to 1) find out if the
document contains specific words, which I have listed in a separate
document
and 2) highlight by bold or underline any occurence of the select words
in
the document.

Is there a way for me to do this automatically. I would like to easily
identify the incidence of the select words in the document without
having
to
read and highlight the document, as I know that I will miss many
incidences
of the words.






  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor
 
Posts: n/a
Default How to find a series of words and then changing formats

That's not strictly true - you could set up a macro containing an array of
the 100 words and run the replacement function on those 100 words. The
following is an example, using 6 words, but provided you don't try and pile
them all on one line, you can use 100 words.

Sub ReplaceList()
Dim vFindText As Variant
Dim vReplText As Variant
Dim i As Long

vFindText = Array("Word1", "Word2", "Word3", _
"word4", "Word5", "etc")
With Selection.Find
.ClearFormatting
.Wrap = wdFindStop
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = False

For i = LBound(vFindText) To UBound(vFindText)
.Text = vFindText(i)
.Replacement.ClearFormatting
.Replacement.Text = "^&"
.Replacement.Highlight = True
.Execute replace:=wdReplaceAll
Next i
End With
End Sub

http://www.gmayor.com/installing_macro.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Richard O. Neville wrote:
You are stuck doing it 100 times, because the Replace function can
handle only one word or string at a time. In other words, you can't
"replace" the words "document," "page," or "line" all at once unless
they are in a string, such as "on the first line of every page in
this document..."
"MolTom" wrote in message
...
Richard, Thank you for your response! I have though about 100 unique
words that I am looking for. Is there a way that I could
find-replace any incidence of the words at one time. Or am I stuck
doing find-replace ~100 times for all the words that I am looking
for. Thanks again!! I welcome your continued advice and help!!


"Richard O. Neville" wrote:

You can do this with the Replace function. Let's suppose you want to
highlight all occurrences of the word "document." Type that word
into the "Find what" box. Type it again in the "Replace with" box,
but this time click More. Select Format-highlight (or
underline--use Format-font), then click Find next. Try it on two or
three replacements; if OK, click Replace
all. You can do the same for strings of words. You may be better off
using
underline unless you have color printers to show the highlighting.

You may have to use "whole words only" because the plural,
documents, would
otherwise not have the terminal "s" highlighted or underlined. Same
would be
true of documentation, documented, etc. This is not a problem with
strings,
if, for instance, you wanted to select "the contract document." You
may also
have to watch for capitalized "Document," which could start a
sentence. "MolTom" wrote in message
...
I have a large Word document in which I would like to 1) find out
if the document contains specific words, which I have listed in a
separate document
and 2) highlight by bold or underline any occurence of the select
words in
the document.

Is there a way for me to do this automatically. I would like to
easily identify the incidence of the select words in the document
without having
to
read and highlight the document, as I know that I will miss many
incidences
of the words.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:45 PM.

Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright 2004-2023 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"