API Documentation > CorelDRAW > 2025-v26 > Polygon > IVGPolygon
Polygon.Sides property
Gets or sets the number of polygon sides
Syntax:
Property Get Sides() As Long
Property Let Sides(ByVal Value As Long)
Remarks:
The Sides property returns or specifies the number of sides for a polygon.
Examples:
The following VBA example displays the number of polygons with a different number of sides in the current document.
Sub Test()
Dim s As Shape
Dim str As String
Dim cnt(3 To 10) As Long, n As Long
For n = 3 To 10
  cnt(n) = 0
Next n
For Each s In ActivePage.Shapes
  If s.Type = cdrPolygonShape Then

 n = s.Polygon.Sides

 If n > 9 Then n = 10


cnt(n) = cnt(n) + 1

 End If
  Next s
  str = "The document contains" & vbCr & _

 "the following polygons:" & vbCr & vbCr & _

 "Sides" & vbTab & "Count"
  For n = 3 To 9

 str = str & vbCr & n & vbTab & cnt(n)
  Next n
  If cnt(10) Then

 str = str & vbCr & "Other" & vbTab & cnt(10)
  End If
  MsgBox str

End Sub