Getting sys colors

Started by mmulvenna, May 23, 2008, 12:27:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mmulvenna

Here we go with another novice question

I would like to present the user (me) with a color chooser to set the fillforegnd color to what ever they choose.

Any VBA coding samples anyone would care to share?

Thanks
Mike

alias....   Mr. Novice :) :) :) :)

Lars-Erik

I don't know how to do this.
What I'd like to know is, why are you doing this using VBA?
Can't the user just use the Visio UI to do this?

- Lars

mmulvenna

Thanks for the pointer. I still need to do it with VBA since I put the color in a user cell and then many shapes reference this cell to get thier fill color. If I can figure out how to call the UI from VBA, will the visio UI allow me to get the color and then put it in a variable and then assign it to a user cell?

The user cell is accessed thru a VBA input form.

Thanks
Mike

Lars-Erik

Probably still not what you wanted to hear BUT:
The shape that 'hosts' the fill data, why not have the others inherent the fillcollor from him and have the users set the color of the shape.
I know its a workaround of what your looking for but still.

In case you DONT want the "master" to have a fillcollor you could put the fillcollor to 100% transparent effectivly rendering it useless, but still letting users set it ?

Lets hope someone knows how to do what you want, but in case noone does, it might be worth a shot?

- Lars (just returning from MASSIVE trojan / virus / mallware battle @ 127.0.0.1 )

mmulvenna

Thanks, that is basically what I am doing. I have one input form that asks the users a number of questions so a shape can be bulit based on the answers. One of the questions is "Fill Color". The fill color then is placed in "user.fill_color" of sheet 1. All other shape "fillforegnd" the reference sheet.1!user.Fill_color.

Again, thanks for the suggestions

Mike

mmulvenna

#5
Okay here is a vba form and code that will do the color picking.

I googled it and made a number of changes. I did not write down the site but all the credit goes to that programmer. :-X


1. Open a new visio form
2. OPen the VBA editor
3. Import the form
4 add a "Dim txtrgb as string" to the code
      (this will contain the rgb colors that the user chose. This is what I inserted into my fillforegnd cell)
5. run the form with <F5>
6. press the Show Color Chart button
7. choose your color from the color palette displayed(you can expand it to get even more colors by pressing the "Define Custom Colors"
8. Press the ok button 


Happy coloring :)
Mike