Table of contents
TOC
折叠目录
展开目录

Validation.RuleSets 属性 (Visio)Validation.RuleSets Property (Visio)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

返回文档中所有验证规则集的集合。只读。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

ValidationRuleSetsValidationRuleSets

示例Example

下面的代码示例基于提供的代码: David ParkerThe following sample code is based on code provided by: David Parker

下面的 Visual Basic for Applications (VBA) 示例演示如何使用规则集属性来获取所有验证规则设置活动文档中的名称和打印在即时窗口中的这些名称。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
© 2018 Microsoft