Viewer.OnLayerChanged event (Visio Viewer)
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
Name | Required/Optional | Data type | Description |
---|---|---|---|
LayerIndex | Required | Long | The index of the changed layer. |
Visible | Required | Boolean | Indicates whether the changed layer is visible in the user interface. |
ColorOverride | Required | Boolean | Indicates whether to override the color of shapes on the changed layer. |
Color | Required | OLE_COLOR | The color of the changed layer, expressed in RGB values. |
ColorTrans | Required | Double | The 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
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.