page border color

C

Charlie

Can I use something like this to programatically change the color of the page
border? I can't figure out how to do it exactly...

With Dialogs(wdDialogFormatBordersAndShading)
'some code here to change the page border to the integer intMyColor
End With

thanks,
ck
 
H

Helmut Weber

Hi Charlie,
change the color of the page border?

I maybe on the wrong track,
but I've never heard about a page border,
and it seems, nobody else either.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
D

Doug Robbins - Word MVP

To change the color of the (existing) border in the first section of the
document, use:

With ActiveDocument.Sections(1)
With .Borders(wdBorderLeft)
.Color = wdColorRed
End With
With .Borders(wdBorderRight)
.Color = wdColorRed
End With
With .Borders(wdBorderTop)
.Color = wdColorRed
End With
With .Borders(wdBorderBottom)
.Color = wdColorRed
End With
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
P

Perry

If visible,the code in previous posting runs fine with me ...
Make them visible using:

With .Borders(wdBorderLeft)
.Color = wdColorRed
.Visible = True
End With
....etc

Krgrds,
Perry
 
C

Charlie

Perry,
Yes it was visible. I did find out that if my border is just a simple box,
it works. But I'm using the ArtBorder... Does this work for you if your
border is an ArtBorder?
thanks,
ck
 
D

Doug Robbins - Word MVP

It is not possible to change the color of all of the ArtBorders,
particularly the ones that are already colored.

If you have a Black Scared Cat Border, the following will change the color
of the cats to Red

With ActiveDocument.Sections(1)
With .Borders(wdBorderLeft)
.ArtStyle = wdArtScaredCat
.ArtWidth = 31
.ColorIndex = wdRed
End With
With .Borders(wdBorderRight)
.ArtStyle = wdArtScaredCat
.ArtWidth = 31
.ColorIndex = wdRed
End With
With .Borders(wdBorderTop)
.ArtStyle = wdArtScaredCat
.ArtWidth = 31
.ColorIndex = wdRed
End With
With .Borders(wdBorderBottom)
.ArtStyle = wdArtScaredCat
.ArtWidth = 31
.ColorIndex = wdRed
End With
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
C

Charlie

Yes, this is close to what I need. However, The .colorindex property only
lets me use a very limited number of colors, in though if I manually go to
the form, I can choose any color from the more extensive list. Say, Aqua,
for example, and many more, I can't get with .colorindex. Is there a way to
use .color? Replacing .colorindex with .color doesn't do it.
 
H

Helmut Weber

Hi Charlie

search the object browser for wdcolor.

wdcolorindex might still be there for backward compatibility.

See help on RGB (Red, Green, Blue) as well.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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