Previous Document Next Document

Object Model Reference : Classes : S : Shapes : Methods : Shapes.FindShapes


Shapes.FindShapes

Function FindShapes([Name As String], [Type As cdrShapeType = cdrNoShape], [Recursive As Boolean = True], [Query As String]) As ShapeRange

Description

Member of Shapes

The FindShapes method finds all shapes with the specified properties and returns them as a shape range.

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).
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.”

VBA example

The following VBA example finds all the rectangles on the current page and fills them with red.

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.