API Documentation > CorelDRAW > 2025-v26 > Document > IVGDocument
Document.ShapeEnumDirection property
Returns or sets the order in which shapes in a collection are enumerated
Syntax:
Property Get ShapeEnumDirection() As cdrShapeEnumDirection
Property Let ShapeEnumDirection(ByVal Value As cdrShapeEnumDirection)
Remarks:
The ShapeEnumDirection property returns or specifies how shapes in the Shapes collection are enumerated. By default, the last-created shape has an index number of 1; that is, it is accessible as Shapes(1), and the value is set to cdrShapeEnumTopFirst. If the value is set to cdrShapeEnumBottomFirst, the first-created shape has an index number of 1.
Examples:
The following VBA example creates an ellipse, and then it creates an artistic text object in a new document and applies a red fill to the ellipse (the bottommost object).
Sub Test()
Dim d As Document
Set d = CreateDocument
d.ShapeEnumDirection = cdrShapeEnumBottomFirst
d.ActiveLayer.CreateEllipse2 4, 4, 2
d.ActiveLayer.CreateArtisticText 0, 0, "Text"
d.ActiveLayer.Shapes(1).Fill.UniformColor.RGBAssign 255, 0, 0 
End Sub