Table of contents
Collapse the table of content
Expand the table of content

Shape.ScaleHeight Method (Project)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Scales the height of the shape by a specified factor.


expression. ScaleHeight(Factor,RelativeToOriginalSize,fScale)

expression A variable that represents a Shape object.


NameRequired/OptionalData TypeDescription
FactorRequiredSingleThe ratio between the height of the shape after you resize it and the current height. For example, to make a rectangle 50 percent higher, specify 1.5 for the Factor parameter.
RelativeToOriginalSizeRequiredMSOTRISTATEmsoFalse scales the shape relative to its current size. For Project, the value must be msoFalse.
fScaleOptionalMSOSCALEFROMSpecifies which part of the shape retains its position when the shape is scaled.
NameRequired/OptionalData typeDescription

Return value



A RelativeToOriginalSize parameter value of msoTrue scales a shape relative to its original size, which applies only to a picture or OLE object.


The following example creates two cylindrical shapes, and then scales the first shape in height and width. If you set a breakpoint on the first ScaleHeight statement, you can step through the code and see the changes from scaling and from using the fScale parameter.

Sub ScaleShapes()
    Dim theReport As Report
    Dim shp1 As shape
    Dim shp2 As shape
    Dim reportName As String
    Dim sRange As ShapeRange

    reportName = "Scale Report"

    Set theReport = ActiveProject.Reports.Add(reportName)
    Set shp1 = theReport.Shapes.AddShape(msoShapeCan, 20, 50, 20, 30)
    Set shp2 = theReport.Shapes.AddShape(msoShapeCan, 140, 50, 30, 50)

    shp1.ScaleHeight 2, msoFalse
    shp1.ScaleWidth 2, msoFalse

    shp1.ScaleHeight 2, msoFalse, msoScaleFromMiddle
    shp1.ScaleWidth 2, msoFalse, msoScaleFromTopLeft
End Sub

See also

Other resources

Shape ObjectMsoTriStateMsoScaleFrom

© 2018 Microsoft