Shape.HasCategory Method (Visio)

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

Version Information

Version Added: Visio 2010

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.