Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
find/replace with font color
Hi, I'm a freelance translator who uses Word all the time but still knows shamefully little about its advanced features : ( I've wasted most of my morning trying to concoct a macro so I thought I'd come here for advice. I'd like to be able to: 1) Highlight a word 2) Hit a button 3) Have all instances of that word change red. I feel certain that this can be done, I just can't figure out how to do it. Right now it's a several step process using ctrl + H. I'd like to make it a one step process. Any help would be appreciated. Thanks ~ vitaminL -- VitaminL |
#2
Posted to microsoft.public.word.newusers
|
|||
|
|||
find/replace with font color
I'm not sure why it would be a several-step process with Replace. That is,
it requires only a single Replace action: 1. In the Replace dialog, type the word (or paste it using Ctrl+V) in the "Find what" box. 2. Click More. 3. With the insertion point in the (blank) "Replace with" box, click Format | Font and choose Font color: Red. 4. Replace All. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA "VitaminL" wrote in message ... Hi, I'm a freelance translator who uses Word all the time but still knows shamefully little about its advanced features : ( I've wasted most of my morning trying to concoct a macro so I thought I'd come here for advice. I'd like to be able to: 1) Highlight a word 2) Hit a button 3) Have all instances of that word change red. I feel certain that this can be done, I just can't figure out how to do it. Right now it's a several step process using ctrl + H. I'd like to make it a one step process. Any help would be appreciated. Thanks ~ vitaminL -- VitaminL |
#3
Posted to microsoft.public.word.newusers
|
|||
|
|||
find/replace with font color
How about the following which will turn red all words that match the word at
the cursor. If you want the search to be case sensitive change the line ..MatchCase = False to ..MatchCase = True Sub TurnEmRed() Dim sFindText As String sFindText = Selection.Words(1) With Selection .HomeKey Unit:=wdStory With .Find .ClearFormatting .Replacement.ClearFormatting '********************** .Text = sFindText .Replacement.Text = "^&" .Replacement.Font.Color = wdColorRed '********************** .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = False .Execute replace:=wdReplaceAll End With 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 VitaminL wrote: Hi, I'm a freelance translator who uses Word all the time but still knows shamefully little about its advanced features : ( I've wasted most of my morning trying to concoct a macro so I thought I'd come here for advice. I'd like to be able to: 1) Highlight a word 2) Hit a button 3) Have all instances of that word change red. I feel certain that this can be done, I just can't figure out how to do it. Right now it's a several step process using ctrl + H. I'd like to make it a one step process. Any help would be appreciated. Thanks ~ vitaminL |
#4
Posted to microsoft.public.word.newusers
|
|||
|
|||
find/replace with font color
Thanks for the help! That macro is almost perfect, I work with Chinese text so it sometimes has difficulties with determining when words start and stop. Is there an easy way to change it to search and replace only for the text I've selected (highlighted)? Thanks again, VitaminL -- VitaminL |
#5
Posted to microsoft.public.word.newusers
|
|||
|
|||
find/replace with font color
Change the line
sFindText = Selection.Words(1) to sFindText = Selection -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org VitaminL wrote: Thanks for the help! That macro is almost perfect, I work with Chinese text so it sometimes has difficulties with determining when words start and stop. Is there an easy way to change it to search and replace only for the text I've selected (highlighted)? Thanks again, VitaminL |
#6
Posted to microsoft.public.word.newusers
|
|||
|
|||
find/replace with font color
Works a charm. Thank you very much~ vitaminL Graham Mayor;2634797 Wrote: Change the line sFindText = Selection.Words(1) to sFindText = Selection -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org VitaminL wrote:- Thanks for the help! That macro is almost perfect, I work with Chinese text so it sometimes has difficulties with determining when words start and stop. Is there an easy way to change it to search and replace only for the text I've selected (highlighted)? Thanks again, VitaminL - -- VitaminL |
#7
Posted to microsoft.public.word.newusers
|
|||
|
|||
find/replace with font color
You are welcome
-- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org VitaminL wrote: Works a charm. Thank you very much~ vitaminL Graham Mayor;2634797 Wrote: Change the line sFindText = Selection.Words(1) to sFindText = Selection -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org VitaminL wrote:- Thanks for the help! That macro is almost perfect, I work with Chinese text so it sometimes has difficulties with determining when words start and stop. Is there an easy way to change it to search and replace only for the text I've selected (highlighted)? Thanks again, VitaminL - |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
replace font color | Microsoft Word Help | |||
Find multiple characters in one find using MSword find/replace | Microsoft Word Help | |||
I want to color underline through Find and Replace | Microsoft Word Help | |||
How Format Painter could copy the font color of a color text? | Microsoft Word Help | |||
Use symbols from a custom font in Find and Replace | Microsoft Word Help |