Hi all,
Sorry if this has been asked before (Im sure it has ; ) )
Ive been playing with Visio 2003 today, and im trying to do something which seemingly 'should' work, but just doesn't. I wonder if someone could point me in the right direction without suggesting VBA, as I am a total noob when it comes to VBA.
As an example;
I have three objects, Object1, Object2 and Object3. These are all grouped together as Group1.
I have assigned a custom property set to Group1.
I am attempting to do two things, based on variable list custom property values;
1) If Group1's custom property Prop.1 equals say "RH" (selected from the list of variables I entered), then I want to FlipX on Group1. So I have placed a formula in FlipX for Group1 as follows:
=if(Prop.1="RH",TRUE,FALSE).
I want this to effectively mirror Group1 based on the custom property.
secondly,
2) If Group1's custom property Prop.2 equals say "Mesh" (selected from the list of variables I entered), then I want to Object1's Fill to equal a diffrerent colour. So I have placed a formula in FillForegnd for Object1 as follows:
=if(Group1!Prop.2="Mesh",2,1).
I want this to effectively fill a member of the group based on the custom property.
Whilst Visio seems to allow me to do all this, changing Group1's custom properties, does not dynamically alter the group/shapes as I intend.
Can anyone shed any light on this?
Thanks in advance,
Whirlpool1
You dont need VBA for this
At the group level, you have a cell....for the sake of this argement lets call it props.mytrigger full name is sheet.4!props.mytrigger
It is a list format where RH and MESH are allowed
At the shape level with in group....for the sake of this argument, lets assume shape 1 cares if "RH"
in shape1's flipx cell, you would have the following formula = if(strsame(sheet.4!props.mytrigger, "RH"), true, false)
At the shape level in group....for the sake of this argument, lets assume shape 3 cares if "MESH"
in shape3's fllforegnd cell you would have = if (strsame(sheet.4!props.mytrigger, "MESH", RGB(255,0,0), RGB(0,0,255))
If you dont want any UI actions to overwrite these shape cells then encase in GUARD aka = Guard(if(strsame(sheet.4!props.mytrigger,"RH"), true, false))
Of course, you certainly could do this in VBA....lots of examples on the web on how to pass a selected shape, walk shapes, find cells, read cells and write cells.
To emphazise a point in vojos answer: Your main problem is:
=if(Prop.1="RH",TRUE,FALSE).
You want to compare two strings, Prop.1 and "RH". That is not possible that way in the ShapeSheet (only in VBA).
In the ShapeSheet you have to use a ShapeSheet-Function called "strsame", the way vojo has done it.
( In vojos is missing a bracket: = if (strsame(sheet.4!props.mytrigger, "MESH"), RGB(255,0,0), RGB(0,0,255)) )
hth Jumpy
fair enough...thx
Fantastic, thanks for the help guys :)
I did manage to get it working with LOOKUP and some User Cells, but STRSAME is much cleaner for me.