Shape.Layer Property
Visio Automation Reference |
Returns the layer to which a shape is assigned. Read-only.
Version Information
Version Added: Visio 4.0
Syntax
expression.Layer(Index)
expression A variable that represents a Shape object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Index | Required | Integer | The ordinal of the layer to get. |
Return Value
Layer
Remarks
If a shape is assigned to three layers, the valid indexes that can be passed to its Layer property are 1 through 3.
To get the number of layers to which a shape is assigned, use the LayerCount property.
Example
This Microsoft Visual Basic for Applications (VBA) macro shows how to use the Layer property to get a reference to a particular layer. It also uses the LayerCount property to determine the number of layers to which a shape is assigned and the Name property to get the name of the current layer.
Visual Basic for Applications |
---|
|
See Also