Partager via


Page.AutoConnectMany Method (Visio)

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

Version Information

Version Added: Visio 2010

Syntax

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

expression A variable that represents a Page object.

Parameters

Name

Required/Optional

Data Type

Description

FromShapeIDs()

Required

Long

An array of identifers of the shapes from which to draw a connection.

ToShapeIDs()

Required

Long

An array of identifers of the shapes to which to draw a connection.

PlacementDirs()

Required

Long

An array of VisAutoConnectDir constants that represent the directions in which to draw the connections. See Remarks for possible values.

Connector

Optional

[UNKNOWN]

The connector to use. Can be a Master, MasterShortcut, Shape, or IDataObject object.

Return Value

Long

Remarks

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.

Constant

Value

Description

visAutoConnectDirDown

2

Connect down.

visAutoConnectDirLeft

3

Connect to the left.

visAutoConnectDirNone

0

Connect without relocating the shapes.

visAutoConnectDirRight

4

Connect to the right

visAutoConnectDirUp

1

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