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 ValidationRuleSet 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 do not 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.