ValidationRule.Delete Method (Visio)
Deletes the ValidationRule object from the document.
Calling the Delete method also deletes all ValidationIssue objects that are associated with the validation rule.
The following sample code is based on code provided by: David Parker
The following Visual Basic for Applications (VBA) example shows how to use the Delete method to delete a validation rule named "Unglued Connector" from the validation rule set named "Fault Tree Analysis" in the active document.
' Delete a named rule from a named rule set. Public Sub Delete_Example() Dim strValidationRuleSetNameU As String Dim strValidationRuleNameU As String Dim vsoValidationRuleSet As Visio.ValidationRuleSet strValidationRuleSetNameU = "Fault Tree Analysis" strValidationRuleNameU = "UngluedConnector" Set vsoValidationRuleSet = ActiveDocument.Validation.RuleSets(strValidationRuleSetNameU) ' Delete the rule. vsoValidationRuleSet.Rules(strRuleNameU).Delete End Sub