This code checks if a layer exists
'Check if layer exists
Public Function LayerExists(varLayerName As String)
Set myDoc = Application.ActiveDocument
LayerExists = False
For Each Layer In myDoc.ActivePage.Layers
If Layer.Name = varLayerName Then LayerExists = True
Next
End Function
Comments