ValidationRuleSets.Add method (Visio)

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

Syntax

expression.Add (NameU)

expression A variable that represents a ValidationRuleSets 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:

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")

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.