API Documentation > CorelDRAW > 2025-v26 > Segment > IVGSegment
Segment.Index property
Gets the index of the segment within its subpath
Syntax:
Property Get Index() As Long
Remarks:
The Index property returns the index number of a segment within its subpath. The Index and AbsoluteIndex properties return the same value if the segment belongs to the first subpath of the curve.
Examples:
The following VBA example loops through all segments of each subpath and prints each segment's Index and AbsoluteIndex property in the Intermediate window of the Macro Editor.
Sub Test()
Dim s As Shape
Dim sp As SubPath
Dim seg As Segment
Set s = ActiveShape
If s.Type = cdrCurveShape Then
  For Each sp In s.Curve.Subpaths

 For Each seg In sp.Segments


Debug.Print seg.Index, seg.AbsoluteIndex

 Next seg
  Next sp
End If 
End Sub