The ValidationRuleSets collection
Validation Rules are grouped within ValidationRuleSets
. The UI provides the ability to import a rule set from another open Visio document, but the programmer can use the Add(NameU as String)
or AddCopy(RuleSet as ValidationRuleSet[, NameU])
methods to create a new one.
You can retrieve a rule set by its index
position in the collection, using ValidationRuleSets.Item(index)
, or by its ID
using ValidationRuleSets.ItemFromID(ID)
. Once you have retrieved a rule set, you can read its Name
(which can be edited to be a localized version), NameU, Description
(which is displayed as the tooltip in the UI), or check if the RuleSets
is enabled for validation.
The RuleSetFlags
value determines if the rule set is visible in the Rules to Check drop-down in the UI.
The default value is 0
(VisRuleSetFlags.visRuleSetDefault), but you could change it to 1
(VisRuleSetFlags.visRuleSetHidden) if you do not want it to appear in the Rules to Check menu.
The following macro, EnumerateRuleSets...