![]() |
![]() |
Layer.FindShapes
Function FindShapes([Name As String], [Type As cdrShapeType = cdrNoShape], [Recursive As Boolean = True]) As ShapeRange
Member of Layer
The FindShapes method locates all shapes on a layer that have the specified properties. It returns a ShapeRange object containing all shapes found.
Parameters
|
Description
|
Name
|
Identifies the string value that uniquely identifies the shape
This parameter is optional.
|
Type
|
Identifies the type of shape. This value returns cdrShapeType.
This parameter is optional, and its default value is cdrNoShape (0).
|
Recursive
|
Specifies whether to iterate through all of the shapes
This parameter is optional, and its default value is True.
|
The following code example finds all rectangles on the current layer and fills them with a red uniform fill:
Sub Test() Dim sr As ShapeRange Set sr = ActiveLayer.FindShapes(Type:=cdrRectangleShape) If sr.Count <> 0 Then sr.ApplyUniformFill CreateRGBColor(255, 0, 0) Else MsgBox "There are no rectangles on the current layer" End If End Sub
![]() |
![]() |
![]() |
Copyright 2007 Corel Corporation. All rights reserved.