Highlighting specific words

G

Guest

Hi all, does anyone know, if you have a file of words you want to keep track
of, if there's a way to automatically highlight those words in another file,
or to put those words in a table in the other file, then automatically
highlight them as they're typed or they already appear in the document?
Thanks!
 
J

Jezebel

You can't do *anything* automatically while you type, other than autocorrect
which isn't going to help you here.

You could write a macro that reads words from a file or table, searches for
them in another document, and formats them in a special way. Would that
help?
 
G

Guest

That would be perfect! I have no idea how to write or use macros, though,
could you possibly direct me to one and give me pointers on how to use it?
Thanks!
 
G

Guest

Thanks John, but I can't seem to find this. Is it only in certain versions
of Word? I have XP.

John McGhie [MVP - Word and Word Macinto said:
Hi Jezzica:

Yes, you can do this with AutoCorrect.

Study the topic "Create an AutoCorrect entry to store and automatically
insert text and graphics" in the Help.

You need to enter the words you want to search for in your AutoCorrect list,
and replace them with the same word highlighted. Make sure you choose the
"Formatted" options or the highlighting won't come in.

Forget macros for this task. You would need to be a seriously good
programmer to make a macro to do this. Ask Jezebel if s/he will send you
one, because I have never seen a macro that could do this with acceptable
performance :)

Hope this helps

That would be perfect! I have no idea how to write or use macros, though,
could you possibly direct me to one and give me pointers on how to use it?
Thanks!

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 
S

Suzanne S. Barnhill

I don't think AutoCorrect will really do what you're thinking about, but see
http://word.mvps.org/faqs/customization/AutoCorrect.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

jezzica85 said:
Thanks John, but I can't seem to find this. Is it only in certain versions
of Word? I have XP.

John McGhie [MVP - Word and Word Macinto said:
Hi Jezzica:

Yes, you can do this with AutoCorrect.

Study the topic "Create an AutoCorrect entry to store and automatically
insert text and graphics" in the Help.

You need to enter the words you want to search for in your AutoCorrect list,
and replace them with the same word highlighted. Make sure you choose the
"Formatted" options or the highlighting won't come in.

Forget macros for this task. You would need to be a seriously good
programmer to make a macro to do this. Ask Jezebel if s/he will send you
one, because I have never seen a macro that could do this with acceptable
performance :)

Hope this helps

That would be perfect! I have no idea how to write or use macros, though,
could you possibly direct me to one and give me pointers on how to use it?
Thanks!

:

You can't do *anything* automatically while you type, other than autocorrect
which isn't going to help you here.

You could write a macro that reads words from a file or table, searches for
them in another document, and formats them in a special way. Would that
help?




Hi all, does anyone know, if you have a file of words you want to keep
track
of, if there's a way to automatically highlight those words in another
file,
or to put those words in a table in the other file, then automatically
highlight them as they're typed or they already appear in the document?
Thanks!

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 
G

Guest

I probably should have said this before (sheepish shrug) but I have almost
7000 words to go through. Is there a way to do them with AutoCorrect without
needing to enter each one individually?

Suzanne S. Barnhill said:
I don't think AutoCorrect will really do what you're thinking about, but see
http://word.mvps.org/faqs/customization/AutoCorrect.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

jezzica85 said:
Thanks John, but I can't seem to find this. Is it only in certain versions
of Word? I have XP.

John McGhie [MVP - Word and Word Macinto said:
Hi Jezzica:

Yes, you can do this with AutoCorrect.

Study the topic "Create an AutoCorrect entry to store and automatically
insert text and graphics" in the Help.

You need to enter the words you want to search for in your AutoCorrect list,
and replace them with the same word highlighted. Make sure you choose the
"Formatted" options or the highlighting won't come in.

Forget macros for this task. You would need to be a seriously good
programmer to make a macro to do this. Ask Jezebel if s/he will send you
one, because I have never seen a macro that could do this with acceptable
performance :)

Hope this helps

On 1/4/06 2:08 PM, in article
(e-mail address removed), "jezzica85"

That would be perfect! I have no idea how to write or use macros, though,
could you possibly direct me to one and give me pointers on how to use it?
Thanks!

:

You can't do *anything* automatically while you type, other than autocorrect
which isn't going to help you here.

You could write a macro that reads words from a file or table, searches for
them in another document, and formats them in a special way. Would that
help?




Hi all, does anyone know, if you have a file of words you want to keep
track
of, if there's a way to automatically highlight those words in another
file,
or to put those words in a table in the other file, then automatically
highlight them as they're typed or they already appear in the document?
Thanks!




--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 
J

John McGhie [MVP - Word and Word Macintosh]

Hi Jezzica:

Yes, you can do this with AutoCorrect.

Study the topic "Create an AutoCorrect entry to store and automatically
insert text and graphics" in the Help.

You need to enter the words you want to search for in your AutoCorrect list,
and replace them with the same word highlighted. Make sure you choose the
"Formatted" options or the highlighting won't come in.

Forget macros for this task. You would need to be a seriously good
programmer to make a macro to do this. Ask Jezebel if s/he will send you
one, because I have never seen a macro that could do this with acceptable
performance :)

Hope this helps

That would be perfect! I have no idea how to write or use macros, though,
could you possibly direct me to one and give me pointers on how to use it?
Thanks!

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 
G

Greg Maxey

I have offered you a possible solution that so far you have choosen to
ignore. Provided you can define your list of 7000 words in a simple table
with the same 7000 words listed as both the find and replace word as then
the Add-in will do it in fairly short order.
 
S

Suzanne S. Barnhill

http://word.mvps.org/FAQs/Customization/ExportAutocorrect.htm offers a
backup/restore macro that produces a plain-text list of AutoCorrect entries,
so presumably it would be possible to merge your list with this one, then
use it to "restore" your AutoCorrect entries.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Guest

As a matter of fact, I didn't ignore your suggestion, Greg. It was the first
thing I tried, and it didn't work. The find and replace didn't replace
anything.
 
G

Guest

Sorry Suzanne, I couldn't get this to work either. Thank you so much for
trying, I'm just horrendous when it comes to macros.
 
G

Greg Maxey

That is odd. I just downloaded the template and gave it a try. I typed:
"One two three four five" in the document and then used the "a Quicklist I
create now" option. I typed "One two three four five" in the Find column
and the Replace column, saved the file and close it. Then checked
"Highlight" and "Go".

Result: One two three four five was highlighted in the document.
 
G

Guest

Thanks for trying Greg, I redownloaded the macro and it still won't work for
me. Maybe it's my computer.
 
J

John McGhie [MVP - Word and Word Macintosh]

Jezzica:

"Won't work" is not giving him enough information to enable him to help you.

Remember he can't read your screen from there :)

His macro DOES work, I know it does because I have used it. But there are
several settings you can make that will prevent it from working.

That's why you need to tell him exactly what happens when you say that it
"doesn't work". He needs that information to tell you what to do next :)

Cheers


Thanks for trying Greg, I redownloaded the macro and it still won't work for
me. Maybe it's my computer.

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 
G

Greg Maxey

jezzica,
While I was napping John replied to your last post superbly ;-). We need to
establish exactly what it is that you are trying to do and where in that
process the macro falls short.
 
G

Guest

OK, let's give it a shot. I made the word list in the predefined words, with
the find and replace columns identical except for the replace column being
red instead of black. What I want to do is whenever a word in the find
column appears in my document, I want to replace it with the red version.
The macro sort of seems to run if I have a very small list of words, say 8 or
10, but it doesn't replace with the red, it looks like it replaces with the
same word, same formatting, when I need the same word with the new
formatting. If I entered in anything more than 15 words, it would tell me
that the string parameter is too long. I've tried it so far in the
predefined list setting and the quicklist setting, and both of them do that.
Maybe 7000 words is just too long for the macro? It's probably some small
thing I'm doing wrong.
 
G

Greg Maxey

Ok,

Part of the problem is that you said you wanted to "highlight" text not
"change the color." The macro does not have a UI feature to change font
color (I might add it). However the code can easily be adapted to change
font color or practically anything else.

Open the template file and the press ALT+F11 to open the VB editor. If not
displayed, press CTRL+R to open the Project Explorer. You will see a
project named "VBA Find and Replace" If not explanded, expand it an you
will see a folder named Forms. Double click the form named UserInterface.
Either the form or the form code will appear. If it is the form the right
click UserInterface again and select few code. Now using the right hand
scrool bar, scrool down in the code until you come to the last Function
named:

Public Function SrchAndReplaceInStory ....

You are going to need to add a line of code.

The twelfth line down reads:
..Replacement.Text = ListArray(i, 2)

immediately after that line add this line:
..Replacement.Font.Color = wdColorRed

Using the file menu in the VB editor now save the project.

Ok, now for your error.

I just process a collection of forty differenct words and phrases with no
errors. Yes, 7000 may be too much for one bite and you might have to do it
in segments, however I don't know why you are having errors at 15. Can you
give me an example of the list of words that you are using?
 
G

Guest

Thanks, I'll definitely try this and see if it works. The words I'm using
are just normal ones, every now and then they might be hyphenated, but no
punctuation marks or special characters, like:

a
able
about
abruptly
absolutely
accept
accident
accused
across
act
acting
actively
actually
adamant
admit

Could there maybe be too many of them in the document?
 
G

Guest

One more thing, I went in and the VBA editor said the file was unviewable.
Did I do something wrong?
 

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