Validating on Shape Data value

Started by Johnny198, April 09, 2014, 08:12:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Johnny198

Hi,

I was wondering if anyone have managed to do this before?

With visio's validate diagram you can write a rule that checks what category the shape has with the function "HasCategory(name)". This function checks the User-defined Cell "User.msvShapeCategories" (in the shapesheet) and returns true if the shape has that category.
Now, the thing I want to do is to check a Cell in the Shape Data (in the shapesheet).
So is there a function where I can tell what kind of cell it should look after? And then make a rule based on that?

Thanks
-John

JatinPatel

 Johnny,

These are custom properties of the shape.
Try this:
'say' your shape has "Cost" as property with "Cost" as label.
The way to access Cost property is

shape.Cells("Prop.Cost").Formula

Then you can make a rule based on this.

Hope this is what you are looking for.

Johnny198

Jatin,

Thank you for the reply.

I did not explain myself good enough. This rule I need to write is in rulesets, the rules that gets validated when pressing the Check Diagram button in the ribbon (under the Process tab).

I have found a way around this, but it is still not the answer to my question. I will post my workaround later just for information.

-John

Johnny198

This is my workaround, it works for this purpose but it makes it a bit difficult for other purposes.

My problem was that I wanted a function in a rule to check a specific cell in the shapesheet. (A rule written in the validation.xml)
There is already a function that checks a cell, hasCategory(), but this only checks the User.msvShapeCategories cell.

So my workaround was that I changed the value of the User.msvShapeCategories cell to refer to another cell value.
With this I then can check any (but only one) cell with the hasCategory().
Then I could also differ between shapes with the masterName() function.

So with the rules I can only differ on two values, one cell and one mastername. But is there a another way on doing this? (Without vba or vsto)