API Documentation > CorelDRAW > 2025-v26 > Segment > IVGSegment
Segment.Type property
Gets or sets the segment type
Syntax:
Property Get Type() As cdrSegmentType
Property Let Type(ByVal Value As cdrSegmentType)
Remarks:
The Type property returns or specifies the type (line or curve) of the segment. This property can be used to convert the segment type between line and curve.
Examples:
The following VBA example counts the number of curve and line segments in the selected curve shape.
Sub Test()
Dim seg As Segment, ls As Long, cs As Long
If ActiveShape Is Nothing Then Exit Sub
  If ActiveShape.Type <> cdrCurveShape Then Exit Sub

 ls = 0

 cs = 0

 For Each seg In ActiveShape.Curve.Segments


Select Case seg.Type


  Case cdrLineSegment



 ls = ls + 1


  Case cdrCurveSegment



 cs = cs + 1


End Select

 Next seg

 MsgBox "The current curve has " & ActiveShape.Curve.Segments.Count & _


" segments including:" & vbCr & _


"Line segments: " & ls & vbCr & _


"Curve segments: " & cs
  
End Sub