Share via


ShapeRange.Align Method

Word Developer Reference

Aligns the shapes in the specified range of shapes.

Syntax

expression.Align(Align, RelativeTo)

expression   Required. A variable that represents a ShapeRange object.

Parameters

Name Required/Optional Data Type Description
Align Required MsoAlignCmd Specifies the way the shapes in the specified shape range are to be aligned.
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 the active document with the left edge of the leftmost shape in the range.

Visual Basic for Applications
  Set myShapeRange = Selection.ShapeRange
myShapeRange.Align msoAlignLefts, False

See Also