API Documentation > CorelDRAW > 2025-v26 > Layers > IVGLayers
Layers.Count property
Returns the number of layers in the collection
Syntax:
Property Get Count() As Long
Remarks:
The Count property returns the number of layers available. To access master layers, you must access the Layers collection of the master page. The master page is accessible as Document.Pages(0).
Examples:
The following VBA example displays the number of master layers in the active document.
Sub Test()
MsgBox "Document contains " & ActiveDocument.Pages(0).Layers.Count & " layer(s)" 
End Sub