ValidationRuleSets.AddCopy method (Visio)

Adds a copy of an existing ValidationRuleSet object to the ValidationRuleSets collection of the document.

Syntax

expression. AddCopy( _RuleSet_ , _NameU_ )

expression A variable that represents a ValidationRuleSets object.

Parameters

Name Required/Optional Data type Description
RuleSet Required ValidationRuleSet The existing rule set to copy and add to the collection of rule sets.
NameU Optional String The universal name to assign to the new validation rule set.

Return value

ValidationRuleSet

Remarks

If you pass a value for the optional NameU parameter, both the Name and NameU properties of the new rule set are assigned the value. If you don't pass a value, Microsoft Visio assigns the new rule set the local and universal name of the existing rule set. In that case, if you copy a rule set within a document, Visio overwrites the existing rule set. However, if you copy a rule set to another document, Visio adds a new rule set to the other document and leaves the existing rule set unchanged.

Similarly, if the value that you pass for the NameU matches the universal name of an existing rule set in the document, Visio overwrites the existing rule set.

If the NameU parameter is not a valid string, Visio returns an Invalid Parameter error.

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.