Switching background color when Clicking - Visio 2016

Started by BillyBoy, August 27, 2018, 09:33:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.



My aim is to switch the background color of several shapes by clicking on another shape. Then when clicking again, every shape comes back to the default color.
Knowing that I use Visio 2016 (and being a beginner with this software), is there a way to manage this task by using the Events or Actions section and then avoiding VBA/JavaScript?
If programming seems to be the most efficient option, I'll go for it.

If the topic has already been mentioned and solved, I would be glad to get redirected to the corresponding thread.

Thank you in advance!


The easiest option may be the code (VBA)
One problem here may be that on "click" Visio actually selects shapes. And it might be not that easy to tell Visio to trigger your code instead.
The common way is actually to use shape actions (shape right-click menu, or "smart-tag" menu) instead.

No-code ShapeSheet solution will most probably take more time and will be less flexible.
You'll need to make formulas in "dependent" shapes depend on some cell in the "trigger" shape, and then toggle the value in the cell in the trigger shape.
Note - there is also no stock "click" event for the ShapeSheet only "double-click".

Another no-code option could be the layers.
You can just duplicate the shapes with different colors on different layers and then toggle the layers.
And then control the layers either with Visio dialog or by some macro (there are a lot of examples here on that)

It looks like you are building some sort of an dashboard, or?
If it is so, do you think it will be practical in your scenario to have an interactive dashboard inside of Visio?



Thank you for your quick answer.
Please find below further details to get a better overview:

I am currently building a process flow (about 50 shapes) with several inputs and outputs. My request is to show the link between those shapes by clicking, double clicking or even hovering the mouse pointer, nevermind.
The relationship between the elements can be displayed by changing the background color, displaying an arrow or framing the shapes. The method is really flexible, just looking for the simplest way to track the path of each deliverable.
Besides, ideally, the final result should also be available while exporting in html format.

The attached illustrations represent the idea I have in mind.



Hello everyone,

Any idea? I understand that the large scope doesn't help to focus on one way, but any clue is welcome.

Thank you in advance.


I have an example of somewhat similar:

The code is inside the document, but it is specific to my SvgExport extension (will not work with bare Visio):


Visio 2019 Pro


Thank you for your answers.

Nikolay's link represents exactly what I would like to do.
Hence, could someone explain me what means "specific to my SvgExport extension (will not work with bare Visio)" ?