Previous Document Next Document

Object Model Reference : Classes : S : ShapeRange : Methods : ShapeRange.SetSizeEx


ShapeRange.SetSizeEx

Sub SetSizeEx(CenterX As Double, CenterY As Double, [Width As Double], [Height As Double])

Description

Member of ShapeRange

The SetSizeEx method sets the size of the shapes in a shape range, treating the range as a single object. You can specify the reference point around which the range is stretched.

 
See also the ShapeRange.SizeWidth and ShapeRange.SizeHeight properties, as well as the ShapeRange.GetBoundingBox and ShapeRange.SetBoundingBox methods.

Parameter
Description
CenterX
Specifies the x-coordinate of the reference point
CenterY
Specifies the y-coordinate of the reference point
Width
Specifies the horizontal size of the shape range after the stretch. This parameter is optional, and its default value is 0.
Height
Specifies the vertical size of the shape range after the stretch. This parameter is optional, and its default value is 0.

VBA example

The following VBA example stretches the shape range on the active layer proportionally, so that its width is 2".

Sub Test()
 Dim x As Double, y As Double
 Dim sr As ShapeRange
 Set sr = ActiveLayer.Shapes.All
 If sr.Count > 0 Then
  ActiveDocument.ReferencePoint = cdrCenter
  sr.GetPosition x, y
  sr.SetSizeEx x, y, 2
 End If
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.