How to identify the shapes connected by a connector

J

JuneTheSecond

Hi juliet.

Please check Connect object in the Visio help.
This is my test code in VBA.
Dim myConn As Visio.Connect
Dim shp As Visio.Shape
For Each myConn In ActivePage.Connects
Set shp = myConn.ToSheet
Debug.Print shp.ID, shp.Name
Next
 
J

juliet jose

hi,
Thanks for the help. I'm just posting a sample code here so that people
can refer if needed
In the code , for each connector i've displayed the shapes that are
glued to that connector.

Visio.Connects visconnects;
Visio.Shape visshape;
Visio.Shape toshape;
Visio.Connect visconnect;

Visio.Page currentPage = axDrawingControl1.Document.Pages[1];

Visio.Shapes shs = currentPage.Shapes;
for (int i = 1; i <= shs.Count; i++)
{

visshape = shs;

//Only if the shape is a connector
if (visshape.LineStyle == "Connector")
{
visconnects = visshape.Connects;
MessageBox.Show("Connector : " + visshape.Name);


for (int k = 1; k <= visconnects.Count; k++)
{
visconnect = visconnects[k];
toshape = visconnect.ToSheet;
MessageBox.Show(toshape.Name);
}
}
}

url:http://www.ureader.com/msg/11301808.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top