Previous Document Next Document
ShapeRange.SetSizeEx

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

Member of ShapeRange

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

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

Parameters
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.

The following code example stretches the shape range on the active layer proportionally, so that its width is 2 inches:

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