Shape.HasCategory method (Visio)

Returns True if the specified category is in the shape categories list.

Syntax

expression. HasCategory( _Category_ )

expression A variable that represents a Shape object.

Parameters

Name Required/Optional Data type Description
Category Required String The name of the category.

Return value

Boolean

Remarks

You can pass only a single category for the Category parameter. Passing a semicolon-delimited list of categories produces an Invalid Parameter error.

Categories are user-defined strings that you can use to categorize shapes and thereby to restrict membership in a container. You can define categories in the User.msvShapeCategories cell in the ShapeSheet for a shape. You can define multiple categories for a shape by separating those categories with semi-colons.

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.