Previous Document Next Document

Object Model Reference : Classes : S : Shape : Properties : Shape.Previous


Shape.Previous

Property Previous([Level As cdrShapeLevel = cdrLevelPage], [EnterGroups As Boolean = False], [Loop As Boolean = True]) As Shape

Description

Member of Shape

The Previous property returns the previous shape in a document.

The Previous property returns a read-only value.

Parameter
Description
Level
Specifies whether to limit the scope to the current group, layer, page, or document. This parameter is optional, and its default value is cdrLevelPage (3).
EnterGroups
Specifies how to handle groups. If this value is set to False, groups are treated as separate shapes, ignoring any shapes within the group. If it is set to True, group shapes are still returned. This parameter is optional, and its default value is False.
Loop
Specifies how to loop through the search. If this value is set to True and the last shape in the scope is reached, the first shape of the group, layer, or document is returned. Otherwise, Nothing is returned. This parameter is optional, and its default value is True.

VBA example

The following VBA example selects the next shape on the current layer. There must be at least two shapes in the document, and one shape must be selected.

Sub Test()
 Dim s As Shape
 Set s = ActiveShape
 If s Is Nothing Then
  MsgBox "Nothing is selected."
 Else
  s.Previous(cdrLevelLayer, True, True).CreateSelection
 End If
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.