API Documentation > CorelDRAW > 2025-v26 > Shapes > IVGShapes
Shapes.FindShape method
Gets a shape based upon specified properties.
Syntax:
Function FindShape(Optional ByVal Name As String, Optional ByVal Type As cdrShapeType = cdrNoShape, Optional ByVal StaticID As Long = 0, Optional ByVal Recursive As Boolean = True, Optional ByVal Query As String) As Shape
Parameters:
Name Type Description
Name
String
Type
Specifies the shape by type.
StaticID
Long
Specifies the unique ID of the shape.
Recursive
Boolean
Specifies whether to iterate through all shapes.
Query
String
Remarks:
The FindShape method returns a shape based upon the specified properties.
Examples:
The following VBA example finds a rectangle named Frame and selects it if it exists.
Sub Test()
Dim s As Shape
Set s = ActivePage.FindShape(Name:="Frame", Type:=cdrRectangleShape)
If s Is Nothing Then
  MsgBox "The rectange 'Frame' cannot be found on page " & ActivePage.Index
Else
  s.CreateSelection
End If 
End Sub