Table of contents
Collapse the table of content
Expand the table of content

Selection.SetContainerFormat Method (Visio)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

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.


expression . SetContainerFormat( FormatType , [FormatValue] )

expression An expression that returns a Selection object.


NameRequired/OptionalData TypeDescription
FormatTypeRequiredVisContainerFormatTypeThe container formatting to change. See Remarks for possible values.
FormatValueOptionalVariantThe new format to apply.

Return Value



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

visContainerFormatLockMembership0Apply one of the LockMembership property values, as specified in FormatValue. FormatValue is required, and must be of type Boolean (preferred) or or another type that can be converted to Boolean .
visContainerFormatContainerAutoResize1Apply 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.
visContainerFormatFitToContents2Fit 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.

© 2018 Microsoft