Selection.SetContainerFormat method (Visio)

Changes the formatting of one aspect of all the containers in the selection, and returns an array of identifiers of shapes that belong to the containers and whose formatting was changed.

Syntax

expression. SetContainerFormat( _FormatType_ , _[FormatValue]_ )

expression An expression that returns a Selection object.

Parameters

Name Required/Optional Data type Description
FormatType Required VisContainerFormatType The container formatting to change. See Remarks for possible values.
FormatValue Optional Variant The new format to apply.

Return value

Long()

Remarks

The FormatType parameter must be one of the following VisContainerFormatType constants.

Constant Value Description
visContainerFormatLockMembership 0 Apply one of the LockMembership property values, as specified in FormatValue. FormatValue is required, and must be of type Boolean (preferred) or another type that can be converted to Boolean.
visContainerFormatContainerAutoResize 1 Apply one of the ResizeAsNeeded property values, as specified in FormatValue. Applies to normal containers only. FormatValue is required, must be of type Short (preferred) or of another type that can be converted to Short, and must be equal to a constant in the range of those in the VisContainerAutoResize enumeration.
visContainerFormatFitToContents 2 Fit contents to the container. FormatValue is ignored.

If the selection does not include any containers, this method has no effect.

If FormatType is of an incorrect type or is out of the range of VisContainerFormatType, Microsoft Visio returns an Invalid Parameter error.

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.