Edit

Share via


Viewer.LayerColor property (Visio Viewer)

Gets or sets the color of the layer at the specified index position in the current drawing open in Microsoft Visio Viewer. Read/write.

Syntax

expression.LayerColor (LayerIndex)

expression An expression that returns a Viewer object.

Parameters

Name Required/Optional Data type Description
LayerIndex Required Long The index of the layer in the collection of layers in the drawing open in Visio Viewer.

Return value

OLE_COLOR

Remarks

Returns a value of data type OLE_COLOR that represents the color of the specified layer in Visio Viewer. The OLE_COLOR data type is used for properties that return colors.

Valid hexadecimal values for an OLE_COLOR data type in Visio Viewer are of the form &Hbbggrr, where bb is the blue value, gg the green value, and rr the red value. All three color values range between 00 and FF hexadecimal (255 decimal).

The collection of layers is one-based, so the index of the first layer in the collection is 1. If there are no layers in the drawing, or if you pass the index of a nonexistent layer, the LayerColor property returns 0.

Example

The following code shows how to get the color of the layer at index position 1 in the drawing open in Visio Viewer.

Debug.Print vsoViewer.LayerColor(1)

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.