API Documentation > CorelDRAW > 2025-v26 > SubPath > IVGSubPath
SubPath.Extract method
Extracts the subpath into a new separate curve
Syntax:
Function Extract(Optional ByRef OldCurve As Shape = Nothing) As Shape
Parameters:
Name Type Description
OldCurve
References the original curve after the extraction by returning a shape.
Remarks:
The Extract method removes a subpath from a curve and creates a separate shape from the extracted subpath. The original curve is modified and cannot be accessed through its previous reference. A new reference to the original curve is returned though the OldCurve parameter after the extraction takes place.
Examples:
The following VBA example extracts each subpath from a curve and changes the outline color of each extracted curve.
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