Connects.Count Issue

Started by mountainch, January 29, 2013, 12:19:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mountainch

Hi all,

I have created a custom shape with 3 connection points.

These 3 connection points are connected to connector as the attachment below shows. When I run a VBA command Shapes(i).Connects.Count for that shape, it suppose to return a value=3.However,the command return me a 0. Why?

Can anyone help me?

Thanks!

aledlund

without the drawing (and access to the shapesheets), how would you expect us to be able to answer the question?
al

Paul Herber

I'll suggest that the connections are made to one or more of the sub-shapes within a grouped shape.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

mountainch

hi all,

I have attached my drawing and i use following code to test....pls help~~Thanks.

Sub test()
Dim i As Integer
Dim vsoShapes As Visio.Shapes
Set vsoShapes = ActivePage.Shapes
For i = 1 To vsoShapes.Count
     If Not vsoShapes(i).CellExists("BeginX", 0) Then
          Debug.Print vsoShapes(i).Connects.Count
     End If

     Next i
End Sub



AndyW

You need to be using FromConnects, this identifies the shapes connected to your shape, i.e. the connectors. Connects gives the shapes that your shape connects to, which in this case is none.
Live life with an open mind

mountainch

Quote from: AndyW on January 29, 2013, 01:35:45 PM
You need to be using FromConnects, this identifies the shapes connected to your shape, i.e. the connectors. Connects gives the shapes that your shape connects to, which in this case is none.
Hi andy,

  Thank for help.It solves my problem~