View Single Post
  #6  
Old December 24th, 2005, 03:41 PM posted to microsoft.public.word.newusers
external usenet poster
 
Posts: n/a
Default Random letter colors?

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

--
Running Word 2000 SP-3 on Windows 2000