Visio Discussions > Deployment

Hiding shapes by clicking button

<< < (2/2)

vojo:
if you want to stay away from VBA and use shapesheet, can do these

action = setf(getref(action.checked), if(action.checked, 0, 1)) + setf(getref(geometry1.noshow), if(action.checked, 0,1))

First setf sets the click flag on the shape dropdown
second, turns the shape display on or off

If You don't want to use layers, you could set flags in page shapesheet to turn catagoires of shapes

shape user cell = setf(getref(geometry1.noshow), if(page!user.x = 1, 0,1))

This would check a page user cell as to whether to show or hide all shapes of this categorie.
In essence, this is similar to layers but using some user specific set of categories to trigger on or off.

<obviously, sloppy syntax...but quite doable...use it all the time>

wapperdude:
Some pros / cons on shapesheet vs vba.
Shapesheet:  avoids macro security issue, is built into Visio.  Disadvantage:  both layers and Vojo's methods require some a priori knowledge as to setting each sheet's identity, e.g., assign to specific layers.  Both require this on a per page basis, e.g., layers not global, but per page.  Similarly, Vojo's approach also needs per page pre-planning.  But both will work fine once setup.

Macro: security issue biggest obstacle.  Obviously, some code writing.  Most flexible.  Other than writing code, not necessary to do pre-planning.  Could be set such that it ignores selected shapes.  Thus, you select shapes not wanted, run macro, shapes become hidden, generate report, then, unhide shapes.

All three methods can do the task.

Wapperdude

Navigation

[0] Message Index

[*] Previous page

Go to full version