Table of contents
Collapse the table of content
Expand the table of content

ValidationRule.FilterExpression Property (Visio)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

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


expression . FilterExpression

expression A variable that represents a ValidationRule object.

Return Value



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


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())"
© 2018 Microsoft