Skip to content

Latest commit

 

History

History
59 lines (34 loc) · 1.49 KB

Visio.ValidationRuleSet.Rules.md

File metadata and controls

59 lines (34 loc) · 1.49 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
ValidationRuleSet.Rules property (Visio)
vis_sdr.chm18262645
vis_sdr.chm18262645
Visio.ValidationRuleSet.Rules
7890ca86-74b3-1dd6-8322-f3fbde235115
06/08/2017
medium

ValidationRuleSet.Rules property (Visio)

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

[!includeSupport and feedback]