ShapeRange.ScaleWidth Method
Publisher Developer Reference |
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.
Syntax
expression.ScaleWidth(Factor, RelativeToOriginalSize, fScale)
expression A variable that represents a ShapeRange object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Factor | Required | Single | Specifies the ratio between the height of the shape after you resize it and the current or original height. For example, to make a rectangle 50 percent larger, specify 1.5 for this argument. |
RelativeToOriginalSize | Required | MsoTristate | Specifies whether to scale relative to the object's original or current size. |
fScale | Optional | MsoScaleFrom | The part of the shape that retains its position when the shape is scaled. |
Return Value
Nothing
Remarks
The RelativeToOriginalSize parameter can be one of the MsoTriState constants declared in the Microsoft Office type library and shown in the following table.
Constant | Description |
---|---|
msoFalse | Scales the shape relative to its current size. |
msoTrue | Scales the shape relative to its original size. |
The fScale parameter can be one of the MsoScaleFrom constants declared in the Microsoft Office type library and shown in the following table. The default is msoScaleFromTopLeft.
msoScaleFromBottomRight |
msoScaleFromMiddle |
msoScaleFromTopLeft |
Shapes other than pictures and OLE objects are always scaled relative to their current width; specifying a RelativeToOriginalSize value of msoTrue for shapes other than pictures or OLE objects causes an error.
Use the ScaleHeight method to scale the height of a shape.
Example
This example scales all pictures and OLE objects on the first page of the active publication to 175 percent of their original height and width, and it scales all other shapes to 175 percent of their current height and width.
Visual Basic for Applications |
---|
|
See Also