AddToContainers Method

Selection.AddToContainers Method (Visio)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Adds the selection of shapes to all underlying containers that allow it as a member.

expression .AddToContainers

expression A variable that represents a Selection object.

Return Value

Nothing

When you call the AddToContainers method, Microsoft Visio uses the setting of the ContainerProperties.ResizeAsNeeded property for each container to determine how the container resizes.

Each shape in the selection is added to its underlying containers according to the position of the shape. As a result, different shapes may end up being contained by different containers. If the underlying container is a list, the shape is added as normal container member, not list member.

The AddToContainers method works only if the selection sits at least partially on top of a container that does not already contain it.

Show:
© 2016 Microsoft