Table of contents
TOC
Collapse the table of content
Expand the table of content

Viewer.OnLayerChanged Event (Visio Viewer)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Occurs when a layer is changed in the document open in Microsoft Visio Viewer.

Syntax

expression. OnLayerChanged( LayerIndex, Visible, ColorOverride, Color, ColorTrans)

_expression_An expression that returns a Viewer object.

Parameters

NameRequired/OptionalData TypeDescription
LayerIndexRequiredLongThe index of the changed layer.
VisibleRequiredBooleanIndicates whether the changed layer is visible in the user interface.
ColorOverrideRequiredBooleanIndicates whether to override the color of shapes on the changed layer.
ColorRequired[OLE_COLOR]The color of the changed layer, expressed in RGB values.
ColorTransRequiredDoubleThe transparency percentage of the changed layer.

Remarks

You can change a layer either in the Layer Properties dialog box, or programmatically by using the LayerColor, LayerColorOverride, LayerColorTrans, and LayerVisible properties.

Example

The following code shows how to use the OnLayerChanged event to display the new transparency percentage of the changed layer in the Immediate window.

Private Sub vsoViewer_OnLayerChanged(ByVal LayerIndex As Long, ByVal Visible As Boolean, ByVal ColorOverride As Boolean, ByVal Color As stdole.OLE_COLOR, ByVal ColorTrans As Double)

    Debug.Print "The new transparency percentage is"; ColorTrans

End Sub
© 2018 Microsoft