API Documentation > CorelDRAW > 2025-v26 > Segments > IVGSegments
Segments.Range method
Creates a range containing the specified segments
Syntax:
Function Range(ByRef ParamArray IndexArray() As Variant) As SegmentRange
Parameters:
Name Type Description
IndexArray
Variant
Remarks:
The Range method returns a SegmentRange object containing all specified segments from a Segments collection. This method accepts a variable number of arguments. It also accepts arrays.
Examples:
The following VBA example converts segments 2, 3, and 4 of the selected curve to lines.
Sub Test()
Dim sgr As SegmentRange
Set sgr = ActiveShape.Curve.Segments.Range(Array(2, 3, 4))
sgr.SetType cdrLineSegment 
End Sub