API Documentation > CorelDRAW > 2025-v26 > Layer > IVGLayer
Layer.FindShape method
Finds a single shape by its name, type or Static ID
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) As Shape
Parameters:
Name Type Description
Name
String
Type
Specifies the shape type, and returns cdrShapeType.
StaticID
Long
Specifies the shape's unique ID.
Recursive
Boolean
Specifies whether to iterate through all shapes.
Remarks:
The FindShape method locates a shape with specified properties on a layer. If the shape cannot be found, an empty reference (nothing) is returned.
Examples:
The following VBA example finds a rectangle named Frame and selects it.
Sub Test()
Dim s As Shape
Set s = ActiveLayer.FindShape(Name:="Frame", Type:=cdrRectangleShape)
If s Is Nothing Then
  MsgBox "The rectangle 'Frame' cannot be found on layer " & ActiveLayer.Name
Else
  s.CreateSelection
End If 
End Sub