API Documentation > CorelDRAW > 2025-v26 > Shapes > IVGShapes
Shapes.FindShapes method
Finds shapes based upon specified properties and returns them as a shape range
Syntax:
Function FindShapes(Optional ByVal Name As String, Optional ByVal Type As cdrShapeType = cdrNoShape, Optional ByVal Recursive As Boolean = True, Optional ByVal Query As String) As ShapeRange
Parameters:
Name Type Description
Name
String
Type
Specifies the shape by type.
Recursive
Boolean
Specifies whether to iterate through all shapes.
Query
String
Remarks:
The FindShapes method finds all shapes with the specified properties and returns them as a shape range.
Examples:
The following VBA example finds all the rectangles on the current page and fills them with red.
Sub Test()
Dim sr As ShapeRange
Set sr = ActivePage.FindShapes(Type:=cdrRectangleShape)
If sr.Count <> 0 Then
  sr.ApplyUniformFill CreateRGBColor(255, 0, 0)
Else
  MsgBox "There are no rectangles on the current page"
End If 
End Sub