Object Model Reference : Classes : S : Shapes : Methods : 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 the specified properties.
Parameter
|
Description
|
Name
|
Specifies the shape by name. This parameter is optional.
|
Type
|
Specifies the shape by type. This parameter is optional, and its default value is cdrNoShape (0).
|
StaticID
|
Specifies the unique ID of the shape. This parameter is optional, and its default value is 0.
|
Recursive
|
Specifies whether to iterate through all shapes. This parameter is optional, and its default value is True.
|
Query
|
Specifies a query through the Corel Query Language (CQL). This parameter is optional.
For information on queries, see the section Including queries in macros. For specific information on searching for objects, see the section Searching for objects.
|
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 |
Copyright 2013 Corel Corporation. All rights reserved.