Now we want to generate the graph using the XML file. But the problem is
that we don't have dynamic Connector in our Stencil.
Previously we used the connector on the Standard Toolbar.
How can we connect the shapes through our VBA code
regards
AMIT
Here are a couple of VBA macros that may help.
1) Drop a connector object on the active page.
Sub DropTheInternalConnector()
' Connector Shape handle
Dim vsoShape As Visio.Shape
Set vsoShape =
ActivePage.Drop(Visio.Application.ConnectorToolDataObject, 1, 4)
End Sub
2) Drop a couple rectangles and connect them.
Sub ConnectRectangles()
' need a couple shapes to connect.
Dim testShape1 As Visio.Shape
Dim testShape2 As Visio.Shape
' draw the shape object on the page
Set testShape1 = Visio.ActivePage.DrawRectangle(1, 1, 2, 2)
Set testShape2 = Visio.ActivePage.DrawRectangle(1, 9, 2, 10)
' define the selection object we will use to connect em.
Dim testSelection As Visio.Selection
' select the shapes via the selection object
Set testSelection = Visio.ActivePage.CreateSelection(visSelTypeAll)
' connect em all
testSelection.ConnectShapes
End Sub
Hope this helps.
--
Zack Moore
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
"Amit Jindal" <amit_...@pspl.co.in> wrote in message
news:eezUfZo$CHA....@TK2MSFTNGP10.phx.gbl...
The macros you have provided don't work.
1)Visio.Application doesn't have any ConnectorToolDataObject object. I tried
getting a reference to the Toolbar Connector but somehow I don't seem to get
it right.
2)Similarly Visio.ActivePage doesn't have any CreateSelection method.
Moreover this macro seems to select all the shapes and then connect them,
which is not the functionality that I desired
I am working on Visio 2000 SR1.
Thanks anyway.
AMIT
"Zack Moore" <za...@Online.Microsoft.com> wrote in message
news:eGtxEas$CHA....@TK2MSFTNGP11.phx.gbl...
Mike
>.
>