Connect Element [Visio 2003 SDK Documentation]

Represents a connection between two shapes in a drawing, such as a line and a box in an organization chart.

Syntax

<Connect
    FromSheet
    FromCell
    [FromPart]
    [ToSheet]
    [ToCell]
    [ToPart]>
</Connect>

Attributes

FromSheet

Required int. The ID of the shape from which a connection or connections originate.

ToSheet

Required int. The ID of the shape to which one or more connections are made.

FromCell

Optional string. The cell from which a connection originates.

Note  The FromCell and FromPart attributes are optional; however, one must be present in the Connect element.

FromPart

Optional int. The part of a shape from which a connection originates.

Note  The FromCell and FromPart attributes are optional; however, one must be present in the Connect element.

Value Description

0

None

1

Left edge

2

Center edge

3

Right edge

4

Bottom edge

5

Middle edge

6

Top edge

7

BeginX cell

8

BeginY cell

9

BeginX/BeginY point

10

EndX cell

11

EndY cell

12

EndX/EndY point

100 + zero-based index of control point

Control point

ToCell

Optional string. The cell to which a connection is made.

Note   The ToCell and ToPart attributes are optional; however, one must be present in the Connect element.

ToPart

Optional int. The part of a shape to which a connection is made.

Note  The ToCell and ToPart attributes are optional; however, one must be present in the Connect element.

Value Description

0

None

1

GuideX

2

GuideY

3

Whole shape

4

Guide intersection

7

To Angle

100 + index of connection point

Connection point

Element properties

Property Value
Name Connect 
Minimum Occurrences
Maximum Occurrences Unbounded 

Element information

Parent elements

Connects

Child elements

None

Remarks

Remarks

Connect elements are always emitted for a DatadiagramML file. However, the Connect elements in a trusted DatadiagramML file are ignored when the file is opened by Microsoft Office Visio.

In untrusted XML files, when Visio opens the file, it uses the Connect elements to set glue formulas for shapes, similar to the GlueTo method in Automation. However, geometry will not be updated, so connectors may need to be manually rerouted.

For more information on trusted DatadiagramML files, see Overview of DatadiagramML.

Example

<Connects>
  <Connect FromSheet="3" FromCell="BeginX" FromPart="9" ToSheet="1" ToCell="Connections.X4" ToPart="103" /> 
  <Connect FromSheet="3" FromCell="EndX" FromPart="12" ToSheet="2" ToCell="Connections.X6" ToPart="105" /> 
  <Connect FromSheet="6" FromCell="BeginX" FromPart="9" ToSheet="2" ToCell="Connections.X5" ToPart="104" /> 
  <Connect FromSheet="6" FromCell="EndX" FromPart="12" ToSheet="5" ToCell="Connections.X3" ToPart="102" /> 
</Connects>

See also

Connect object

GlueTo method