Hide master

Started by perry59, May 05, 2017, 05:23:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

perry59

I know the question has been asked before, but I don't think it was ever resolved.

I seen someone post this vba code:
Visio.ActiveDocument.Masters("MyMaster").Hidden = True
but that did not work. Also, preceeding the shape name with an underscore, i.e. "_shapename" did not work either.

Is it possible to "hide" a master in a stencil?
what, me worry?

wapperdude

Do you have reference to that post?

My opinion is no.  The stencil only shows icons, not actual shapes.  There is no mechanism to hide icons, other than deleting them. 

You could edit the master, assign it to a layer, make the layer non-visible.  This has the effect of leaving a blank square with X thru it instead of icon.  Master name still shows.  Don't think you can set font color to white.  The Master still drags and drops, but nothing appears.  You have to re-edit the master, undo the layer assignment to make it re-appear.  Not perfect, but reasonable work-around.

Wapperdude
Visio 2019 Pro

Nikolay

As of my knowledge, you are doing all correct. You can hide masters in stencils, Microsoft themselves used this technique...
You could find hidden masters in UML stencils for example, or in Database stencils.

Please note that your code line hides master in the current document.
Which may not be the stencil, but a drawing (diagram), if you have a drawing with docked stencils opened (every diagram has it's own "stencil", so-called "document stencil")

So try to do it like this:
Visio.Documents("myStencil.vss").Masters("MyMaster").Hidden = True

Keep in mind, that "MyStencil.vss" should be opened for editing

wapperdude

#3
Nikolay is spot on.   :D   ...my error.

Wapperdude

Visio 2019 Pro

perry59

Quote from: Nikolay on May 05, 2017, 10:32:44 PM
As of my knowledge, you are doing all correct. You can hide masters in stencils, Microsoft themselves used this technique...
You could find hidden masters in UML stencils for example, or in Database stencils.

Please note that your code line hides master in the current document.
Which may not be the stencil, but a drawing (diagram), if you have a drawing with docked stencils opened (every diagram has it's own "stencil", so-called "document stencil")

So try to do it like this:
Visio.Documents("myStencil.vss").Masters("MyMaster").Hidden = True

Keep in mind, that "MyStencil.vss" should be opened for editing

You Da Man Nikolay!
Good point you made above about the current document, that's probably why my original code did not work (as expected).
I changed it as you shown and it works perfectly.
Thanks!!!
what, me worry?