You can use dynamic glue without mentioning a specific connection
point. Here's some C# code that might help:
using Visio = Microsoft.Office.Interop.Visio;
/// <summary> I glue a 1-D connector shape to two other shapes.
</summary>
/// <param name="connector"> The connector shape </param>
/// <param name="target"> The shape the connector will connect from.
</param>
/// <param name="source"> The shape the connector will connect to.
</param>
public static void GlueConnector(Shape connector, Shape target, Shape
source) {
GlueConnector(connector, target);
connector.get_Cells("BeginX").GlueTo(source.get_Cells("PinX"));
}
public static void GlueConnector(Shape connector, Shape target) {
connector.SetCellNumber("GlueType",
(short)Visio.VisCellVals.visGlueTypeWalking);
connector.VisioShape.get_Cells("EndX").GlueTo(target.VisioShape.get_Cells("PinX"));
}
public void SetCellNumber(string cellName, double number) {
this.get_Cells(cellName).set_Result(VisNumber, number);
}
public const short VisNumber = (short)Visio.VisUnitCodes.visNumber;
HTH,
Larry