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

Shape.ScaleWidth Method (PowerPoint)

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

Scales the width of the shape by a specified factor. For pictures and OLE objects, you can indicate whether you want to scale the shape relative to the original size or relative to the current size. Shapes other than pictures and OLE objects are always scaled relative to their current width.

Syntax

expression. ScaleWidth( Factor, RelativeToOriginalSize, fScale )

expression A variable that represents a Shape object.

Parameters

NameRequired/OptionalData TypeDescription
FactorRequiredSingleSpecifies the ratio between the width of the shape after you resize it and the current or original width. For example, to make a rectangle 50 percent larger, specify 1.5 for this argument.
RelativeToOriginalSizeRequiredMsoTriStateSpecifies whether a shape is scaled relative to its current or original size.
fScaleOptionalMsoScaleFromThe part of the shape that retains its position when the shape is scaled.

Remarks

For pictures and OLE objects, you can indicate whether you want to scale the shape relative to the original size or relative to the current size. Shapes other than pictures and OLE objects are always scaled relative to their current width.

The RelativeToOriginalSize parameter value can be one of the following MsoTriState constants. You can specify msoTrue for this parameter only if the specified shape is a picture or an OLE object.

ConstantDescription
msoFalseScales the shape relative to its current size.
msoTrueScales the shape relative to its original size.

The fScale parameter value can be one of the following MsoScaleFrom constants. The default is msoScaleFromTopLeft.

|| |:-----| |msoScaleFromBottomRight| |msoScaleFromMiddle| |msoScaleFromTopLeft|

Example

This example scales all pictures and OLE objects on myDocument to 175 percent of their original height and width, and it scales all other shapes to 175 percent of their current height and width.

Set myDocument = ActivePresentation.Slides(1)

For Each s In myDocument.Shapes
    Select Case s.Type
      Case msoEmbeddedOLEObject, msoLinkedOLEObject, _
            msoOLEControlObject, msoLinkedPicture, msoPicture 
        s.ScaleHeight 1.75, msoTrue
        s.ScaleWidth 1.75, msoTrue

      Case Else
        s.ScaleHeight 1.75, msoFalse
        s.ScaleWidth 1.75, msoFalse

    End Select
Next s

See also

Concepts

Shape Object

© 2018 Microsoft