Previous Document Next Document
Shapes.FindShape

Function FindShape([Name As String], [Type As cdrShapeType = cdrNoShape], [StaticID As Long], [Recursive As Boolean = True], [Query As String]) As Shape

Member of Shapes

The FindShape method returns a shape based upon specified properties.

Parameters
Description
Name
Specifies a shape by its name
This parameter is optional.
Type
Specifies a shape by its type
This parameter is optional, and its default value is cdrNoShape (0).
StaticID
Specifies a value that represents a shape’s unique ID
This parameter is optional, and its default value is 0.
Recursive
Specifies whether to iterate through all of the shapes
This parameter is optional, and its default value is True.
Query
Allows you to specify a query by using the Corel Query Language (CQL). For information on performing queries, please see the section “Performing queries.”
For specific information on searching for objects, please see the section “How can objects be searched for?”
This parameter is optional.

The following code 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 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.