Previous Document Next Document

Object Model Reference : Classes : P : Page : Methods : Page.FindShapes


Page.FindShapes

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

Description

Member of Page

The FindShapes method locates all shapes that have certain properties on a page. It returns a ShapeRange object that contains all shapes that are found.

Parameter
Description
Name
Specifies the name of the shape on the page. This parameter is optional.
Type
Specifies the type of shape, and returns cdrShapeType. 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.

VBA example

The following VBA example finds all rectangles on the active page and fills them with a uniform red fill.

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.