Compartir a través de


ValidationRuleSets.Add Method (Visio)

Adds a new, empty ValidationRuleSet object to the ValidationRuleSets collection of the document.

Version Information

Version Added: Visio 2010

Syntax

expression .Add(NameU)

expression A variable that represents a ValidationRuleSet object.

Parameters

Name

Required/Optional

Data Type

Description

NameU

Required

String

The universal name to assign to the new validation rule set.

Return Value

ValidationRuleSet

Remarks

If the NameU parameter is not a valid string or if it matches the universal name of an existing rule set in the document, Microsoft Visio returns an Invalid Parameter error.

The default property values of the new validation rule set are as follows: Description = [empty]; Enabled = True; Name = NameU; RuleSetFlags = visRuleSetDefault.

Example

The following Visual Basic for Applications (VBA) example shows how to use the Add method to add a validation rule set named "Connectivity" to the active document.

Set vsoDocument = Visio.ActiveDocument

' Add a validation rule set to the document.
Set vsoValidationRuleSet = 
vsoDocument.Validation.RuleSets.Add("Connectivity")