Muokkaa

Jaa


Validation.RuleSets property (Visio)

Returns the collection of all the validation rule sets in the document. Read-only.

Syntax

expression. RuleSets

expression A variable that represents a Validation object.

Return value

ValidationRuleSets

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 RuleSets property to get the names of all the validation rule sets in the active document and print those names in the Immediate window.

Public Sub RuleSets_Example()

    Dim vsoDocument As Visio.Document
    Dim vsoRuleSet As Visio.ValidationRuleSet
    Dim vsoValidationRule As Visio.ValidationRule
    
    Set vsoDocument = Visio.ActiveDocument
    
    For Each vsoRuleSet In vsoDocument.Validation.RuleSets
    
        If vsoRuleSet.Enabled Then
            
            Debug.Print vsoRuleSet.NameU
            
        End If
    Next 
       
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.