ValidationRule.FilterExpression Property (Visio)

Gets or sets the logical expression that determines whether the validation rule should be applied to a target object. Read/write.

Version Information

Version Added: Visio 2010

Syntax

expression .FilterExpression

expression A variable that represents a ValidationRule object.

Return Value

String

Remarks

When you validate a diagram by calling the Validate method or by clicking Check Diagram on the Process tab, Microsoft Visio uses the expression that you set as the FilterExpression property value to determine whether a target object must satisfy the validation rule. If the filter expression you set evaluates to True, Visio uses the TestExpression property value you set to determine whether to generate an issue for the target object. If the filter expression evaluates to False, Visio does not apply the validation rule to the target object during validation.

The syntax for the FilterExpression property value is the same as that for a ShapeSheet expression. When you set the FilterExpression property, Visio does not validate the syntax of the filter expression. If the expression is not syntactically correct, Visio does not apply the validation rule to the target object during validation

Example

The following Visual Basic for Applications (VBA) example shows how to use the FilterExpression property to determine whether a particular shape target must satisfy a validation rule.

' The validation function Is1D() returns a Boolean value that 
' indicates whether the shape is 1D (True) or 2D (False).
vsoValidationRule.FilterExpression = "NOT(Is1D())"