API Documentation > CorelDRAW > 2025-v26 > Page > IVGPage
Page.FindShapes method
Returns a collection of shapes (ShapeRange) based on search criteria on a referenced page
Syntax:
Function FindShapes(Optional ByVal Name As String, Optional ByVal Type As cdrShapeType = cdrNoShape, Optional ByVal Recursive As Boolean = True) As ShapeRange
Parameters:
Name Type Description
Name
String
Type
Specifies the type of shape, and returns cdrShapeType.
Recursive
Boolean
Specifies whether to iterate through all shapes.
Remarks:
The FindShapes method locates all shapes that have certain properties on a page. It returns a ShapeRange object that contains all shapes that are found.
Examples:
The following VBA example finds all rectangles on the active page and fills them with a uniform red fill.
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