How do I make every other letter a different color?

S

serras_baby3773

I am having a hard time switchind every other letter a different color
between two colors without all the extra work!! Please help me
 
G

Graham Mayor

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Suzanne S. Barnhill

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.
 

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