Visio Discussions > ShapeSheet & Smart Shapes
Print a layer based on file properties
(1/1)
BenG:
Hello -
I have a custom watermark on a layer of my "background" page. The text of the watermark is pulled from the "description" field of the file properties.
This watermark needs to print in all cases unless the description field = "MFG Release"
I tried adding the following logic to the shapesheet for the background page for the relevant layer:
Print: IF(DESCRIPTION()="MFG RELEASE",FALSE,TRUE)
This logic seems to work the first time it is entered but will not re-evaluate when the description field changes.
Any ideas? Would it be better to handle this in VB code rather than the ShapeSheet?
Regards
Visio Guy:
Hi BenG,
I assume you're already in the ShapeSheet... Anyway, text comparison is a bit tricky. You need to use the STRSAME function to get it done, otherwise Visio will try to evaluate the text as a formula or a number. For generic strings, that value is effectively 0, which tricks people into thinking that their comparison is working half the time.
So try this, where your layer in question is in the second row of the Page ShapeSheet's Layers section:
Layers.Print[2] = IF( STRSAME( DESCRIPTION(), "MFG RELEASE" ), FALSE, TRUE )
or just
Layers.Print[2] = NOT( STRSAME( DESCRIPTION(), "MFG RELEASE" ) )
BenG:
Perfect! Thanks for the help.
BTW: Great Forum!
Navigation
[0] Message Index
Go to full version