Previous Document Next Document

Object Model Reference : Classes : S : Shape : Methods : Shape.Clone


Shape.Clone

Function Clone([OffsetX As Double], [OffsetY As Double]) As Shape

Description

Member of Shape

The Clone method clones a shape and returns a reference to that clone.

Parameter
Description
OffsetX
Specifies the horizontal distance to offset the cloned shape. This parameter is optional, and its default value is 0.
OffsetY
Specifies the vertical distance to offset the cloned shape. This parameter is optional, and its default value is 0.

VBA example

The following VBA example creates a red rectangle, clones it, and then changes the fill of the clone to green.

Sub Test()
 Dim rs As Shape, cs As Shape
 Set rs = ActiveLayer.CreateRectangle2(0, 0, 4, 2)
 rs.Fill.UniformColor.CMYKAssign 0, 100, 100, 0
 Set cs = rs.Clone(0, 3)
 cs.Fill.UniformColor.CMYKAssign 100, 0, 100, 0
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.