word colors

S

samearle

How do I add the below???

I opened a new word doc, went to tools - visuall basic editor. Then
added the following to module1:

ThisDocument.Colors(1) = RGB(100, 200, 200)
ThisDocument.Colors(2) = RGB(100, 200, 200)
ThisDocument.Colors(55) = RGB(100, 200, 200)
ThisDocument.Colors(56) = RGB(100, 200, 200)

basically, what I am trying to do is change collors to custom collors
every time the document opens. To eliminate the document reverting to
standard colors or custom set on that machine.

Thanks,

Sam
 
T

Tony Jollans

Word doesn't have a 56-colour palette like Excel does. There is no 'standard
set' or colour scheme associated with a document.

In Word 2000 and above you can use any combination of the full range of RGB
colours in any document. Your options are more limited in Word 97 - there
are fewer colours available and you can't control what they are.
 
S

samearle

How would I set them to be automatic? Ergo, when a document opens, the
colors are in the palette for use? Or, when opened, the defaut font is
a specific color and font?
 
D

Dave Lett

Hi,

You could intercept the New and Open events and insert something like the
following:

With Selection.Font
.Name = "Arial"
.Color = RGB(100, 200, 200)
End With

You could create a code template that's attached to your document or in the
startup directory that has a toolbar with commands for each of your colors.

HTH,
Dave
 
S

samearle

Wow - I'm sure that is great, and I'm sure it work - problem is I'm a
novice.

I guess you are saying, put in the VBA:

Private Sub Document_Open()
With Selection.Font
.Name = "Arial"
.Color = RGB(100, 200, 200)
End With
End Sub

Then save the document, or save it as a template?

Thanks,

S.
 
J

Jean-Guy Marcil

(e-mail address removed) was telling us:
(e-mail address removed) nous racontait que :
Wow - I'm sure that is great, and I'm sure it work - problem is I'm a
novice.

I guess you are saying, put in the VBA:

Private Sub Document_Open()
With Selection.Font
.Name = "Arial"
.Color = RGB(100, 200, 200)
End With
End Sub

Then save the document, or save it as a template?

It depends. Do you need a template or a document?

Generally, when there is code, we use template. then you will need something
like:


'When a document based on this template is opened...
'but is this code still needed when already saved document are opened?
Private Sub Document_Open()
SetFontColour
End Sub

'When new documents are created based on this template
Private Sub Document_New()
SetFontColour
End Sub

Private SetFontColour()
With Selection.Font
.Name = "Arial"
.Color = RGB(100, 200, 200)
End With
End Sub



--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
S

samearle

Jen-Guy,

Merci! Tres Bein!!! Wish I knew french.....

I think it has worked. I put the following in the VBA, then saved the
document at a template:

Private Sub Document_Open()
SetFontColour
End Sub

Private Sub Document_New()
SetFontColour
End Sub

Private SetFontColour()
With Selection.Font
.Name = "Arial Narrow"
.Color = RGB(60, 70, 100)
End With
End Sub

Thanks so much.

Sam
 
S

samearle

Jen-Guy,

Merci! Tres Bein!!! Wish I knew french.....

I think it has worked. I put the following in the VBA, then saved the
document at a template:

Private Sub Document_Open()
SetFontColour
End Sub

Private Sub Document_New()
SetFontColour
End Sub

Private SetFontColour()
With Selection.Font
.Name = "Arial Narrow"
.Color = RGB(60, 70, 100)
End With
End Sub

Thanks so much.

Sam
 
J

Jean-Guy Marcil

(e-mail address removed) was telling us:
(e-mail address removed) nous racontait que :
Jen-Guy,

Merci! Tres Bein!!! Wish I knew french.....

I think it has worked. I put the following in the VBA, then saved the
document at a template:

Private Sub Document_Open()
SetFontColour
End Sub

Keep in mind that this part will only affect the selection when you open the
document, i.e, the first character.
This is why I asked if this was necessary.
If you want to change the whole document, different code is needed.


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
T

Tony Jollans

I'm glad that you're happy but I really don't understand what you've
achieved.

In the first place you were asking about a colour palette but now you just
want a single default colour in a template - that doesn't need code at all.

Open your template for editing. Select Fomat > Styles and Formatting (or
equivalent if you're not using 2003). Modify the Normal Style to have your
chosen colour. Get rid of the code. Save and Close.
 

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