Page.LayoutIncremental method (Visio)

Makes small adjustments to the position of shapes on the drawing page to better align the shapes or to space them evenly from other shapes.

Syntax

expression. LayoutIncremental( _AlignOrSpace_ , _AlignHorizontal_ , _AlignVertical_ , _SpaceHorizontal_ , _SpaceVertical_ , _UnitsNameOrCode_ )

expression A variable that represents a Page object.

Parameters

Name Required/Optional Data type Description
AlignOrSpace Required VisLayoutIncrementalType The type of incremental layout action to perform--alignment, spacing, or both. See Remarks for possible values.
AlignHorizontal Required VisLayoutHorzAlignType Indicates how Microsoft Visio aligns shapes horizontally when it aligns incrementally. See Remarks for possible values.
AlignVertical Required VisLayoutVertAlignType Indicates how Visio aligns shapes vertically when it aligns incrementally (except if layout style is circular). See Remarks for possible values.
SpaceHorizontal Required Double The edge-to-edge horizontal spacing. Must be greater than or equal to zero.
SpaceVertical Required Double The edge-to-edge vertical spacing (except if layout style is circular). Must be greater than or equal to zero.
UnitsNameOrCode Required VisUnitCodes The units for the spacing values.

Return value

Nothing

Remarks

The AlignOrSpace parameter must be one or the combination of both (3) of the following VisLayoutIncrementalType constants.

Constant Value Description
visLayoutIncrAlign 1 Align shapes.
visLayoutIncrSpace 2 Space shapes evenly.

The AlignHorizontal parameter must be one of the following VisLayoutHorzAlignType constants.

Constant Value Description
visLayoutHorzAlignNone 0 Do not align horizontally.
visLayoutHorzAlignDefault 1 Visio chooses how to align horizontally.
visLayoutHorzAlignLeft 2 Align the left edges of the shapes.
visLayoutHorzAlignCenter 3 Align the centers of the shapes.
visLayoutHorzAlignRight 4 Align the right edges of the shapes.

The AlignVertical parameter must be one of the following VisLayoutVertAlignType constants.

Constant Value Description
visLayoutVertAlignNone 0 Do not align vertically.
visLayoutVertAlignDefault 1 Visio chooses how to align vertically.
visLayoutVertAlignTop 2 Align the top edges of the shapes.
visLayoutVertAlignMiddle 3 Align the middles of the shapes.
visLayoutVertAlignBottom 4 Align the bottom edges of the shapes.

If AlignOrSpace is visLayoutIncrAlign, either AlignHorizontal must be a value other than visLayoutHorzAlignNone, or AlignVertical must be a value other than visLayoutVertAlignNone.

If AlignOrSpace is visLayoutIncrSpace, both AlignHorizontal and AlignVertical must be greater than zero.

If AlignOrSpace is a combination of visLayoutIncrAlign and visLayoutIncrSpace, both of these conditions must be true.

If the page layout style is circular, Visio uses only the AlignHorizontal value to determine whether to align, and only the SpaceHorizontal value to determine whether to space, ignoring the AlignVertical and SpaceVertical values, respectively. In this case, if you pass anything other than visLayoutHorzAlignNone for AlignHorizontal , Visio performs the alignment. Similarly, if you pass any value greater than zero for SpaceHorizontal , Visio performs the spacing.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.