Connection validation

J

Jithesh

Hi,

I have a secenario like to validate connection points between two shapes.

Each shape has connection points like Input and output and while i drag and
drop a connection shape between two shapes i just want to validate whether
input of the one shape connect to out put of the other .

can anyone help me which event of the connection shape can i have this
validation routine and how?

Thanks
Jithesh
 
J

JuneTheSecond

This is my test program placed in ThisDocument moduke.
Each connection point has name such as InPut1.

Option Explicit

Private WithEvents MyPage As Visio.Page

Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
Set MyPage = ActivePage
End Sub

Private Sub Document_DocumentSaved(ByVal doc As IVDocument)
Set MyPage = ActivePage
End Sub

Private Sub MyPage_ConnectionsAdded(ByVal Connects As IVConnects)
Dim MySheet As Visio.Shape
Dim MyConnector As Visio.Shape
Dim MyCell As Visio.Cell

Set MySheet = Connects.ToSheet
Set MyConnector = Connects.FromSheet
Set MyCell = MyConnector.Connects(1).ToCell

Debug.Print MySheet.Name, MyCell.Name

End Sub
 

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