Corel VBA provides a function for adding layers, but that one reports an error when the layer already exists and stops the code.
ATTENTION: Requires LayerExists Function (Page 2)
'Create a new layer
Public Sub LayerCreate(varLayerName As String)
Set myDoc = Application.ActiveDocument
If Not LayerExists(varLayerName) Then myDoc.ActivePage.CreateLayer (varLayerName)
End Sub
Comments