How do I make every other letter a different color?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having a hard time switchind every other letter a different color
between two colors without all the extra work!! Please help me
 
Kind of bizarre requirement, but you could do it with Find and Replace --

1. Enable wildcards. Search for: (?)(?) Replace with: \1|\2 For the
| insert any character that doesn't otherwise occur in your document.

2. Search for: (|?) Replace with: \1 and click the format button,
select the font color you want.

3. Disable wildcards. Search for: | replace with nothing.
 
serras_baby3773 said:
I am having a hard time switchind every other letter a different color
between two colors without all the extra work!! Please help me

If this is a regular requirement for a particular piece of text, format the
text and save it as an autotext entry (or formatted autocorrect).


As Jezebel has indicated you cannot replace text with alternative colours
using a single pass. If you want both colours to be different i.e. neither
black, then there are four replacements in total. These are best linked with
a macro. Unfortunately the macro recorder does not record font formatting,
so you will have to insert the extra code manually. The required colours
were not indicated in the original post, so I have taken a guess at red and
blue - if you need a different colour then change one or both where
indicated. If you don't know what to do with the macro code see
http://www.gmayor.com/installing_macro.htm

Select the text to be formatted and run the macro.

Sub AlternateColours()
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "(?)(?)"
.Replacement.Text = "\1|\2"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute replace:=wdReplaceAll

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "|?"
.Replacement.Text = ""
'**********************************************
.Replacement.Font.Color = wdColorRed
'**********************************************
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute replace:=wdReplaceAll

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "|"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute replace:=wdReplaceAll

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ""
.Font.Color = wdColorAutomatic
.Replacement.Text = ""
'**********************************************
.Replacement.Font.Color = wdColorBlue
'**********************************************
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute replace:=wdReplaceAll

End Sub

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
In addition to the suggestions from Jezebel and Graham, if you are trying to
do this manually, make sure you have "When selecting, automatically select
entire word" disabled on the Edit tab of Tools | Options.

--
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.
 
Back
Top