View Single Post
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default How to save a color to palette without recreating it. (Word, 2002)

On Mon, 18 Jan 2010 14:49:01 -0800, b4a5s
wrote:

I'm doing a Table and each cell has one of four background colors. They are
not on the default "Fill Colors", so I have to go in and reselect the RGB
each time. How can I put the color on the palette? Or is there another way
to save it so all I have to do is click on it when I need that color?


You can record or write four macros, one to apply each color, and put
buttons on a toolbar to run the macros.

If you record a macro while you apply a shaded background to a cell,
you'll get something like this:

Sub Sample()
Selection.Shading.Texture = wdTextureNone
Selection.Shading.ForegroundPatternColor = wdColorAutomatic
Selection.Shading.BackgroundPatternColor = 11182170
End Sub

The number represents the RGB color, by a rather complex formula. But
it's easy to write a macro that's more understandable, like this one
(see http://www.gmayor.com/installing_macro.htm if needed):

Sub BlueShade()
Selection.Shading.BackgroundPatternColor = _
RGB(red:=80, green:=184, blue:=244)
End Sub

To make the other macros, just change the name BlueShade to something
that describes another color, and change the numbers for red, green,
and blue.

To make buttons for the macros, see
http://www.word.mvps.org/FAQs/Custom...oToToolbar.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.