Previous Document Next Document
Shape.SetSize

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

Member of Shape

The SetSize method stretches the shape so it becomes of the specified width and height.

The shape is stretched relative to the reference point specified by the Document.ReferencePoint property. If either parameter is omitted, the other parameter is calculated based on the other dimension to maintain proportions. You cannot omit both parameters, though.

See also the SetBoundingBox method, as well as the SizeWidth and SizeHeight properties of the Shape object.

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

The following code example resizes all existing shapes on the active page:

Sub Test() 
 Dim s As Shape 
 ActiveDocument.ReferencePoint = cdrBottomLeft 
 For Each s In ActivePage.Shapes 
  s.SetSize 1, 1 
 Next s 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.