Previous Document Next Document

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


ShapeRange.SetSize

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

Description

Member of ShapeRange

The SetSize method sets the size of the shapes in a shape range, treating the range as a single object.

 
The reference point around which to stretch the range is specified by the Document.ReferencePoint property.

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

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

VBA example

The following VBA example stretches all the shapes on the active layer so that the vertical size of each shape is 1.

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