Table of contents
TOC
Collapse the table of content
Expand the table of content

ValidationRule.TargetType Property (Visio)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Determines the type of object to which the validation rule applies. Read/write.

Syntax

expression . TargetType

expression A variable that represents a ValidationRule object.

Return Value

VisRuleTargets

Remarks

Valid validation-rule targets include documents, pages, and shapes. The TargetType property value must be one of the following VisRuleTargets constants.

ConstantValueDescription
visRuleTargetShape0The rule applies to shapes in the document.
visRuleTargetPage1The rule applies to pages in the document.
visRuleTargetDocument2The rule applies to the document itself.

If you pass any other value to the TargetType property, Visio returns an invalid-parameter error.

Example

The following Visual Basic for Applications (VBA) example shows how to use the TargetType property to specify the type of object to which the validation rule named "Unglued2DShape" should apply.

Set vsoValidationRule = vsoValidationRuleSet.Rules.Add("Unglued2DShape")
vsoValidationRule.TargetType = Visio.VisRuleTargets.visRuleTargetShape
© 2017 Microsoft