Working with the ValidationRuleSets collection

Validation Rules are grouped within ValidationRuleSets. The UI provides the ability to import a built-in ruleset (Flowchart or BPMN 2.0) or a ruleset 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.

The following code could be run from the Immediate window in VBA:

Visio.ActiveDocument.Validation.RuleSets.Add "bVisual"
Working with the ValidationRuleSets collection

You can retrieve a ruleset by its index position in the collection, using ValidationRuleSets.Item(index), or by its ID using ValidationRuleSets.ItemFromID(ID). Once you have ...

Get Microsoft Visio 2013 Business Process Diagramming and Validation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.