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

ValidationRuleSet.Rules Property (Visio)

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

Returns the collection of validation rules in the validation rule set. Read-only.

Syntax

expression . Rules

expression A variable that represents a ValidationRuleSet object.

Return Value

ValidationRules

Example

The following sample code is based on code provided by: David Parker

The following Visual Basic for Applications (VBA) example shows how to use the Rules property to get the names of all the validation rules in an existing validation rule set named "Fault Tree Analysis" in the active document. The example then prints those names in the Immediate window.

Public Sub Rules_Example()

    Dim vsoDocument As Visio.Document
    Dim vsoValidationRule As Visio.ValidationRule
    Dim strValidationRuleSetNameU As String

    Set vsoDocument = Visio.ActiveDocument
    strValidationRuleSetNameU = "FaultTreeAnalysis"

    For Each vsoValidationRule In vsoDocument.Validation.RuleSets(strValidationRuleSetNameU).Rules

        Debug.Print vsoValidationRule.NameU

    Next

End Sub
© 2018 Microsoft