Share via


ConnectorToolDataObject Property [Visio 2003 SDK Documentation]

Returns an IDataObject interface representing the active Connector tool used in the Microsoft Office Visio user interface.

objRet = object.ConnectorToolDataObject()**

objRet    IDataObject. The active Connector tool in the current Visio instance.

object     Required. An expression that returns an Application object.

Version added

2003

Remarks

By default, ConnectorToolDataObject returns the built-in Visio Connector tool. If a master from a stencil is the active connector, ConnectorToolDataObject returns a data object for that master. If Visio fails to retrieve the internal IDataObject, it raises an exception.

Example

The following Microsoft Visual Basic for Applications (VBA) macro shows how to use the ConnectorToolDataObject property to connect two shapes. It drops two masters on the page and connects them with a Dynamic Connector shape, using dynamic glue. Before running this macro, open the Basic Shapes stencil, if it is not already open.

Public Sub ConnectorToolDataObject_Example()    
    
    Dim vsoSquareShape As Visio.Shape
    Dim vsoCircleShape As Visio.Shape
    Dim vsoConnectorShape As Visio.Shape
    
    Dim vsoCell1 As Visio.Cell
    Dim vsoCell2 As Visio.Cell
    Dim vsoCell3 As Visio.Cell
    Dim vsoCell4 As Visio.Cell
    
    Set vsoSquareShape = ActiveWindow.Page.Drop(Documents("BASIC_U.VSS").Masters.ItemU("Square"), 4, 9)
    Set vsoCircleShape = ActiveWindow.Page.Drop(Documents("BASIC_U.VSS").Masters.ItemU("Circle"), 4#, 6)
    Set vsoConnectorShape = Application.ActiveWindow.Page.Drop(Application.ConnectorToolDataObject, 2, 2)
       
    Set vsoCell1 = ActivePage.Shapes(3).Cells("BeginX")
    Set vsoCell2 = ActivePage.Shapes(1).CellsSRC(7, 0, 0)
    vsoCell1.GlueTo vsoCell2

    Set vsoCell3 = ActivePage.Shapes(3).Cells("EndX")
    Set vsoCell4 = ActivePage.Shapes(2).CellsSRC(7, 1, 0)
    vsoCell3.GlueTo vsoCell4
    

End Sub

Applies to | Application object | InvisibleApp object