Working with the ValidationIssues collection
The ValidationIssues
collection stores the issues created by the Validation.Validate([RuleSet as ValidationRuleSet][, Flags as ValidationFlags])
method and by the RuleSet.AddIssue([TargetPage as Page][,TargetShape as Shape])
method. It can be reset using the Clear()
method, which will also zero LastValidatedDate
of the parent Validation
object.
Most issues are automatically created by the Validate()
method but you can write code to add issues whenever the user clicks on Check Diagram against a particular ruleset. You would do this by listening to the RuleSetValidated(RuleSet as ValidationRuleSet)
event of the Application
, Documents
, or Document
object. This technique is used by the Microsoft SharePoint 2013 Workflow template in Visio 2013.
You can enumerate the current issues in a document, and check which rule has been transgressed, using the following code:
Public Sub EnumerateIssues()
Dim issue As Visio.ValidationIssue
Dim shpName As String
Dim...