Share via


Align Method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Aligns the shapes in the specified range of shapes.

expression.Align(Align, RelativeTo)

expression   Required. An expression that returns one of the objects in the Applies To list.

MsoAlignCmd

MsoAlignCmd can be one of these MsoAlignCmd constants.
msoAlignCenters
msoAlignMiddles
msoAlignTops
msoAlignBottoms
msoAlignLefts
msoAlignRights

RelativeTo  Required Long. . True to align shapes relative to the edge of the document. False to align shapes relative to one another.

Example

This example aligns the left edges of all the shapes in the selection of shapes in myDocument with the left edge of the leftmost shape in the range.

  Set myShapeRange = Selection.ShapeRange
myShapeRange.Align msoAlignLefts, False