Visio Guy

Visio Discussions => Programming & Code => Topic started by: Nikolay on December 11, 2020, 10:26:13 PM

Title: How to select default fill color?
Post by: Nikolay on December 11, 2020, 10:26:13 PM
How do I select default fill color (programmatically?). This button's color "main" color I mean:

(https://i.paste.pics/248215ed0943ef1a06c292669c82dfc4.png)
Title: Re: How to select default fill color?
Post by: Surrogate on December 12, 2020, 05:31:13 AM
А ви с какой целью интересуетесь ?
Why you ask? (c)
Title: Re: How to select default fill color?
Post by: Nikolay on December 12, 2020, 09:39:59 AM
Because i think there may be a simple way to do that, but i may be just not aware of it..
recently had to do some eyedrop picking and copying hex colors, so thinking maybe some tool can be made to simplify this.
Title: Re: How to select default fill color?
Post by: Croc on December 12, 2020, 10:35:49 AM
Perhaps this is stored in the registry. Look here or near

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Visio\Toolbars\MruColors]
"1359"=dword:fe8f95d9
"1404"=dword:ffc07000
"1385"=dword:feffffff   <-----------
Title: Re: How to select default fill color?
Post by: Nikolay on December 12, 2020, 10:40:28 AM
This is a bit too extreme...  :) Also does no look usable at runtime unfortunately. I was hoping for something like
Application.DefaultFillColor = color
Title: Re: How to select default fill color?
Post by: Croc on December 12, 2020, 12:09:08 PM
GestureFormat doesn't work either?
Debug.Print ActiveDocument.GestureFormatSheet.Cells("Fillforegnd").ResultIU
Title: Re: How to select default fill color?
Post by: Nikolay on December 12, 2020, 12:16:07 PM
I have not tried, but this is something i hoped for! Sounds really promising. Will try.

-- update --
tried it, seems to have no effect unfortunately:

ActiveDocument.GestureFormatSheet.Cells("FillBkgnd")= 2