Retrieve Office/Word toolbar colors

C

Communicator CX

Hi

I want to make my own Word toolbar.

So I require the 2 or more colors from the actual toolbar in Office/Word.

How can I retrieve them, f.e. from the registry.

Thank you

tobias
 
T

Tony Jollans

Make your own toolbar and ignore the colours. They are Windows colours and
you don't really have programmatic control over them.
 
T

Tobias Gro.

Hi

I need the colors in VB.

Sure, if you create a Word toolbar, you already have these colors from Word.

But if you use VB und want to create a Word like toolbar. You need these
colors.
hardcoded color seems to be not good because of diffrent word versions and
OS/OS colors.

Thank you
tobias
 
J

Jonathan West

Hi Tobias,

The problem is that the colors don't stay the same, even within a particular
version of Word, they change according to the Windows XP theme the user has
set.

You can of course create a real Word toolbar from within VB, by hooking up
to the Word object model. Would this serve your needs?

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
T

Tony Jollans

Hi tobias,

AFAIK you have no control over the colours in Word. The underlying colour,
if you like, is, I think, grey but the colours actually displayed are
defined in Windows properties - exactly which ones I'm not sure.
 
T

TC

He isn't saying that he wants to control them. He's saying that he
wants to /get/ them, so he can make his own toolbars the same.

OP, could use win32 APIs (getpixel?) to get the color of the toolbars
in question? Then you would not have to code the value in.

HTH,
TC
 
T

Tony Jollans

I'll grant that it is theoretically possible for Word to present them as
read-only properties but when I said they weren't controllable from Word, I
really meant they weren't accessible. Sorry.

The fact remains that the colours (or certainly some aspects of them) depend
on Windows settings and there is no point getting hold of what's in use at
any one point - assuming Word is open at the time - if it can be changed by
the user the minute after it's been picked up . To match Word one must use a
system setting rather than actual colours.
 
T

TC

Tony said:
The fact remains that the colours (or certainly some aspects of them) depend
on Windows settings and there is no point getting hold of what's in use at
any one point - assuming Word is open at the time - if it can be changed by
the user the minute after it's been picked up.

I'm saying for his application to retrieve those settings at runtime,
and make his toolbar use that color (at runtime). Then he is guaranteed
to be using the same color that Word is using at that instant.

But certainly it would be better if he could do this using standard
propeties or system settings.

Cheers,
TC
 
T

Tobias Gro.

Thank you for your postings.

GetPixel is a nice function, but I have to find a toolbar first, before I
can get its colors.

Sure, I want to get the Windows theme/System color properties.
Does anybody know what colors Word uses?

This is the original question.
I has made traces from the registry, with regmon. But there are to much
colors changed, f.e. from blue to silver under WXP.
And the Hex or decimal values doesn't be the same as a color picker displays
me.

When you change all color in the "windows screen color property manager" the
needed colors are NOT changed.
So I think, these colors are only availabe from the registry itself.

I could create a toolbar in Word, right. But I need a special design AND it
has to run from Word 97 up to 2003++.
I have to control this toolbar. I think, only doing the toolbar from VB.

Or can anybody tell me how to get the windows handle from my own (new)
created Word toolbar? So I could make my form as a child from this
(SetParent) and make a transperent form.

Thank you
tobias
 

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