Application.ConnectorToolDataObject property (Visio)
Returns an IDataObject interface representing the active Connector tool used in the Microsoft Visio user interface. Read-only.
Syntax
expression.ConnectorToolDataObject
expression A variable that represents an Application object.
Return value
IDataObject
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
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기