Previous Document Next Document

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


Shape.SetSize

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

Description

Member of Shape

The SetSize method stretches a shape to fit a 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, however.

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

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

VBA example

The following VBA example resizes all 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 2013 Corel Corporation. All rights reserved.