Partager via


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.

Version Information

Version Added: Visio 2010

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 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.