Print a layer based on file properties

Started by BenG, June 02, 2008, 03:15:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

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" ) )

For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

BenG

Perfect!  Thanks for the help.

BTW: Great Forum!