API Documentation > CorelDRAW > 2025-v26 > Page > IVGPage
Page.CreateLayer method
Creates a layer
Syntax:
Function CreateLayer(ByVal LayerName As String) As Layer
Parameters:
Name Type Description
LayerName
String
Remarks:
The CreateLayer method adds a new layer to a document. If the layer is created on a master page, it becomes a master layer.
Examples:
The following VBA example adds a new layer named MyLayer to the active page and creates a rectangle on the new layer.
Sub Test()
Dim lr As Layer
Set lr = ActivePage.CreateLayer("MyLayer")
lr.CreateRectangle 0, 0, 2, 2 
End Sub