API Documentation > CorelDRAW > 2025-v26 > SubPaths > IVGSubPaths
SubPaths.Count property
Gets the number of subpaths in the subpath collection
Syntax:
Property Get Count() As Long
Remarks:
The Count property returns the number of subpaths in a SubPaths collection.
Examples:
The following VBA example extracts each subpath from a curve and changes the color of each extracted subpath.
Sub Test()
Dim spath As SubPath
Dim s As Shape, sExt As Shape
Dim i As Long
Set s = ActiveShape
If s.Curve.Subpaths.Count < 2 Then Exit Sub
  For i = s.Curve.Subpaths.Count To 1 Step -1

 Set spath = s.Curve.Subpaths(i)

 Set sExt = spath.Extract(s)

 sExt.Outline.Width = 0.01

 sExt.Outline.Color = ActivePalette.Color(13 + i)
  Next i

End Sub