How can I disable the AutoConnect Functionality throughProgrammatically

S

shailendrasingh823

Hi All,

I want to connect Some Digital Shapes like AND Gate,OR
Gate,Inverter,But when I pass the Connection Information & GlueTo
Function performs the connecting action it's connecting some other
Connection Points.

Not exact where I have defined the Connection Points.Where these
connections are getting connect there is no connection point I have
defines in Master shape.

I think It's problem with Auto Connect which is working automatically.

If any body knows about the solution please let me know,

Shail
 
J

JuneTheSecond

It might be to set Settings.EnableAutoConnect for Visio application into
false.
 
J

John Goldsmith

Hello Shail,

Visio adds hidden connections when using dynamic connectors. You can't see
them in the ShapeSheet but you can via code, so you just need to handle this
as you search your connections.

You can see the connections by running the following code on a blank
document:

Sub TestShapeConnections()

Dim shp1 As Shape
Dim shp2 As Shape

'Drop two rectangles onto the page
Set shp1 = ActivePage.DrawRectangle(1, 1, 2, 2)
Set shp2 = ActivePage.DrawRectangle(3, 3, 4, 4)

'Report the connections count
Call ReportShapeConnections(shp1)
Call ReportShapeConnections(shp2)

'Connect the shapes
With ActiveWindow
.DeselectAll
.Select shp1, visSelect
.Select shp2, visSelect
.Selection.ConnectShapes
End With

'Report the connections count again
Call ReportShapeConnections(shp1)
Call ReportShapeConnections(shp2)

End Sub

Private Sub ReportShapeConnections(ByRef shp As Shape)
Debug.Print shp.NameID, _
shp.Connects.Count, _
shp.FromConnects.Count
End Sub

Best regards

John


John Goldsmith
www.visualSignals.typepad.co.uk
www.visualSignals.co.uk
 

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