title | ms.service | ms.assetid | ms.date | ms.localizationpriority |
---|---|---|---|---|
Shape.ScaleHeight method (Project) |
project-server |
9dd7a3ee-9149-4aa2-c4ad-5fc0ca45ee21 |
06/08/2017 |
medium |
Scales the height of the shape by a specified factor.
expression.ScaleHeight (Factor, RelativeToOriginalSize, fScale)
expression A variable that represents a Shape object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
Factor | Required | Single | The 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. |
RelativeToOriginalSize | Required | MSOTRISTATE | msoFalse scales the shape relative to its current size. For Project, the value must be msoFalse. |
fScale | Optional | MSOSCALEFROM | Specifies which part of the shape retains its position when the shape is scaled. |
Factor | Required | FLOAT | |
RelativeToOriginalSize | Required | MSOTRISTATE | |
fScale | Optional | MSOSCALEFROM | |
Name | Required/Optional | Data type | Description |
Nothing
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
Shape Object MsoTriState MsoScaleFrom
[!includeSupport and feedback]