Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

ValidationRule.TargetType Property (Visio)

Published: July 16, 2012

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

Version Added: Visio 2010

expression .TargetType

expression A variable that represents a ValidationRule object.

Return Value

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

Constant

Value

Description

visRuleTargetShape

0

The rule applies to shapes in the document.

visRuleTargetPage

1

The rule applies to pages in the document.

visRuleTargetDocument

2

The rule applies to the document itself.

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

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
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.