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

Page.AutoConnectMany Method (Visio)

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

Automatically draws multiple connections in the specified directions between the specified shapes. Returns the number of shapes connected.


expression . AutoConnectMany( FromShapeIDs() , ToShapeIDs() , PlacementDirs() , [Connector] )

expression A variable that represents a Page object.


NameRequired/OptionalData TypeDescription
FromShapeIDs()RequiredLongAn array of identifers of the shapes from which to draw a connection.
ToShapeIDs()RequiredLongAn array of identifers of the shapes to which to draw a connection.
PlacementDirs()RequiredLongAn array of VisAutoConnectDir constants that represent the directions in which to draw the connections. See Remarks for possible values.
ConnectorOptional[UNKNOWN]The connector to use. Can be a Master , MasterShortcut , Shape , or IDataObject object.

Return Value



For the PlacementDirs() parameter, pass an array of values from the VisAutoConnectDir enumeration to specify the connection directions (that is, where to locate the connected shapes with respect to the primary shapes). Possible values for PlacementDirs() are as follows.

visAutoConnectDirDown2Connect down.
visAutoConnectDirLeft3Connect to the left.
visAutoConnectDirNone0Connect without relocating the shapes.
visAutoConnectDirRight4Connect to the right
visAutoConnectDirUp1Connect up.

Calling the AutoConnectMany method is equivalent to calling the Shape.AutoConnect method multiple times.

You can include the same shape multiple times in each array you pass as a parameter. You cannot use the AutoConnectMany method to connect a shape to itself.

If a particular AutoConnectMany operation fails or is invalid, Microsoft Visio skips it and processes the next item in each of the parameter arrays. AutoConnectMany returns the total number of items successfully processed.

If the parameter arrays do not each contain the same number of values, Visio returns an Invalid Parameter error.

The optional Connector parameter value must be an object that references a one-dimensional routable shape. If you do not pass a value for Connector , Visio uses the default dynamic connector.

If you use the IDataObject interface to pass a selection of shapes for Connector , Visio uses only the first shape. If Connector is not a Visio object, Visio returns an Invalid Parameter error. If Connector is not a shape that matches the context of the method, Visio returns an Invalid Source error.

© 2017 Microsoft