ValidationRule.AddIssue method (Visio)

Creates a new validation issue that is based on the validation rule, and adds it to the document.

Syntax

expression. AddIssue( _[TargetPage]_ , _[TargetShape]_ )

expression A variable that represents a ValidationRule object.

Parameters

Name Required/Optional Data type Description
TargetPage Optional Page The page that has the issue. May be Nothing.
TargetShape Optional Shape The shape that has the issue. May be Nothing.

Return value

ValidationIssue

Remarks

TargetPage and TargetShape identify the specific object that is associated with the issue. If the object that you pass for either parameter is not a valid object, or if it is inconsistent with the rule's target type, Microsoft Visio returns an Invalid Parameter error.

If you don't pass a value for the optional TargetShape parameter, the validation issue target is the page.

If you don't pass values for either of the optional parameters, the validation issue target is the document.

Example

The following Visual Basic for Applications (VBA) example shows how to use the AddIssue method to add a custom validation issue to a validation rule and associate it with a particular shape on a particular page.

' Add a custom issue to the vsoValidationRule validation rule and 
' associate it with shape vsoShape on page vsoPage.
Set vsoValidationIssue = vsoValidationRule.AddIssue(vsoPage, vsoShape)

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.