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
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>