Previous Document Next Document
ShapeRange.SetSize

Sub SetSize([Width As Double], [Height As Double])

Member of ShapeRange

The SetSize method sets the size of the shapes in the range, treating the group of shapes as a single object. The reference point around which the range is stretched is specified by the Document.ReferencePoint property.

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

Parameters
Description
Width
Sets the width of the range, in document units
This parameter is optional, and its default value is 0.
Height
Sets the height of the range, in document units
This parameter is optional, and its default value is 0.

The following code example stretches all of the shapes on the active layer so that the vertical size of each shape is one:

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.SetSize x, 1 
 End If 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.