Connect.ToCell Property
Visio Automation Reference |
Gets the cell to which a connection is made. Read-only.
Version Information
Version Added: Visio 2.0
Syntax
expression.ToCell
expression A variable that represents a Connect object.
Return Value
Cell
Remarks
A connection is defined by a reference in a cell in the shape from which the connection originates to a cell in the shape to which the connection is made. The ToCell property returns the Cell object to which the connection is made.
Following is a list of possible connections and their related ToCell property values.
From the begin or end cell of a 1-D shape to...
- A connection point cell: The ToCell property returns the Connection.Xi cell.
- A cell of a guide or guide point: When the begin or end cell of a 1-D shape is glued to a cell of a guide or guide point, two connections are created—one from the endpoint's X cell to the guide's Angle cell, and the other from the endpoint's Y cell to the guide's Angle cell. The ToCell property of both Connect objects returns the Angle cell.
- The pin of a 2-D shape (creates dynamic glue): The ToCell property returns the PinX cell.
- Any cell of a vertex row in a Geometry section: A new connection point is created and the ToCell property returns the Connections.Xi cell.
- The begin or end cell of a 1-D shape: A new connection point is created and the ToCell property returns the Connections.Xi cell.
- The edge (a cell in the Alignment section) of a 2-D shape: A new connection point is created and the ToCell property returns the Connections.Xi cell.
From the edge (a cell in the Alignment section) of a 2-D shape to acell of a guide or guide point: The ToCell property returns the Angle cell.
From an outward or inward/outward connection point cell of a 1-D shape to An inward or inward/outward connection point cell that is not a cell of a guide or guide point: When these cells are glued, two connections are created—one from the BeginX cell of the 1-D shape to the Connections.Xi cell, and the other from the EndX cell of the 1-D shape to the Connections.Yi cell. The ToCell property returns Connections.Xi for the first Connect object and Connections.Yi for the other.
From an outward or inward/outward connection point cell of a 2-D shape that is not a guide or guide point to an inward or inward/outward type connection point cell that is not a cell of a guide or guide point: If the outward connection point is directionless, the ToCell property returns the Connections.Xi cell. If the outward connection point has a direction, two connection points are created. The ToCell property returns the Connections.Xi cell for both Connect objects.
From a control handle to...
- A connection point cell: The ToCell property returns the Connections.Xi cell.
- A cell of a guide or guide point: When a control point is glued to a cell of a guide or guide point, two connections are created—one from the control point's X cell to the guide's PinX and the other from the control point's Y cell to the guide's PinY cell. The ToCell property of the first Connect object returns the guide's PinX cell and, for the second Connect object, the guide's PinY cell.
- Any cell of a vertex row in a Geometry section: A new connection point is created and the ToCell property returns the Connections.Xi cell.
- The begin or end cell of a 1-D shape: A new connection point is created and the ToCell property returns the Connections.Xi cell.
- The edge (a cell in the Alignment section) of a 2-D shape: A new connection point is created and the ToCell property returns the Connections.Xi cell.
Example
This Microsoft Visual Basic for Applications (VBA) macro shows how to extract connection information from a Microsoft Office Visio drawing. The example displays the connection information in the Immediate window.
This example assumes there is an active document that contains at least two connected shapes.
Visual Basic for Applications |
---|
|
See Also