API Documentation > CorelDRAW > 2025-v26 > Curve > IVGCurve
Curve.SubPaths property
Gets the collection of subpaths within the curve
Syntax:
Property Get SubPaths() As SubPaths
Remarks:
The SubPaths property returns all the subpaths in a curve. A subpath is a curve or shape within a single curve object. A curve objects can have several subpaths, and each member of a SubPaths collection is identified by its index number. For example, Subpaths(2) refers to the second subpath of a selected curve object in CorelDRAW.
Examples:
The following VBA example creates a rectangle around each subpath of each curve in the selection.
Sub Test()
Dim s As Shape
Dim spath As SubPath
Dim x1 As Double, y1 As Double, x2 As Double, y2 As Double
ActiveDocument.ReferencePoint = cdrBottomLeft
For Each s In ActiveSelection.Shapes
  If s.Type <> cdrCurveShape Then s.ConvertToCurves

 If s.Type = cdrCurveShape Then


For Each spath In s.curve.Subpaths


  x1 = spath.PositionX


  y1 = spath.PositionY


  x2 = x1 + spath.SizeWidth


  y2 = y1 + spath.SizeHeight


  ActiveLayer.CreateRectangle x1, y1, x2, y2


Next spath

 End If
  Next s

End Sub