View Single Post
  #9   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor
 
Posts: n/a
Default Random letter colors?

Am I missing something here - if the aim of this was as originally described
"I am writing some Santa letters to some kids
in a playful font and I would like to print them in color" then what's the
point of the extra sophistication? Any of the suggestions posted would do
the job. Macros are there to help you work, not to spend more time on them
than the original job they replace.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


LurfysMa wrote:
On Sat, 24 Dec 2005 16:08:20 +0200, "Graham Mayor"
wrote:

Another possibility is the inverse of Jay's code

Sub RandomColors()
Dim oCh As Range
Dim myColor As Word.WdColorIndex
Randomize
For Each oCh In Selection.Characters
Do
myColor = 14 * Rnd() + 1
Loop Until (myColor = wdBlue) Or (myColor = wdRed) Or
(myColor = wdGreen)
oCh.Font.ColorIndex = myColor
Next oCh
End Sub


I was thinking of defining an array to hold the desired list of
colors. I'll have to figure out what the numbers are for red and green
(for Christmas letters). Then I could either select them randomly or
cycle through them.

I'll play with these variations.

Thanks