Hi all, new here, and have found so many qusetions answered here and Oberon - thank YOU. I do have a question though.
I have a toolbar with macros to open and close different palettes. Each palette represents a type of fabric. The company I work for has certain colors in certain fabrics, so in order to restrict the user from choosing a color we don't have, we thought we would have a different palette for each fabric (yes, it could get out of hand with the number of palettes).
What I want to do is track the active shape/curve on the document, and then the color that is active/selected on the palette. Or maybe a palette_OnClick as my access mind would think. Through that, I can query against a database and get information that I would like to store in the ObjectData of the shape, specifically a MaterialID.
I have tried phrasing this all sorts of different ways in Google and am not finding solutions. ActiveColor on the Palette, OnClick of Palette, "Color Clicked"
Let me know what you guys think!
It might help to play out a bit how you would want this to work, in practice.
So, for example, you're working in CorelDRAW, and have VBA code that runs whenever the SelectionChange event fires (which includes selecting an item or changing its fill or outline color).
What do you want to do when that event fires?
Wow, I didn't realize SelectionChange existed. I see how that works, generally. I see that I can capture the color being selected from the palette.
I am having a problem retrieving the ObjectData for the object that triggered the SelectionChange. For instance, I CTRL+click an object, and can get the color, but the ObjectData("Name") doesn't seem to return.
Here's what I have, please forgive me for struggling to format in this little response box.
Private Sub GlobalMacroStorage_SelectionChange() Dim s As Shape Dim c As ColorIf ActiveSelection.Shapes.Count = 0 Then Exit Sub Else Set s = ActiveSelection If s.Shapes.Count > 0 Then Set c = s.Fill.UniformColor Debug.Print s.ObjectData("Name") Debug.Print c.Name End If End IfEnd Sub