Partager via


CONTAINERSHEETREF Function

Returns a sheet reference to the specified container that contains the shape.

Version Information

Version Added: Visio 2010

Syntax

CONTAINERSHEETREF(index[, category]**)

Parameters

Name

Required/Optional

Data Type

Description

index

Required

Integer

The 1-based index of the container. See Remarks for more information.

category

Optional

String

The category of the container. See Remarks for more information.

Return Value

ShapeSheet reference

Remarks

The index of a container is calculated based on the z-order of containers from front to back.

Categories are user-defined strings that you can use to categorize shapes. 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 the categories with semi-colons.

If the shape is not a member of a container, or if there is no container that matches both the specified index number and the category, CONTAINERSHEETREF returns #REF!.

Example

CONTAINERSHEETREF(1)!Height

Returns the value in the Height cell of the container that is most forward on the page to which the shape belongs.