Previous Document Next Document

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


Page.FindShape

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

Description

Member of Page

The FindShape method locates a shape that has the specified properties. If the shape cannot be found on the page, an empty reference (Nothing) is returned.

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).
StaticID
Specifies the shape’s unique ID. 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.

VBA example

The following VBA example finds a rectangle named Frame and selects it.

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 2013 Corel Corporation. All rights reserved.