共用方式為


ConnectorFormat.EndConnectedShape 屬性 (Publisher)

會傳回代表指定連接線的終點所連接之圖案的 Shape 物件。

語法

表情EndConnectedShape

一個代表 ConnectorFormat 物件的變數。

傳回值

圖形

註解

如果指定連接線的終點並不連接到圖案,將會發生錯誤。

使用 BeginConnectedShape 屬性可傳回與連接線的起點相連的圖案。

範例

此範例假設活躍出版物的第一頁已包含兩個由名為 Conn1To2 的連接器連接的形狀。 程式碼在第一頁新增了一個矩形和一個連接器。 新連接器的末端將連接到與該連接器末端相同的連接點 Conn1To2,而新連接器的起始部分則會連接到新矩形上的連接點一。

Dim shpNew As Shape 
Dim intSite As Integer 
Dim shpOld As Shape 
 
With ActiveDocument.Pages(1).Shapes 
 
 ' Add new rectangle. 
 Set shpNew = .AddShape(Type:=msoShapeRectangle, _ 
 Left:=450, Top:=190, Width:=200, Height:=100) 
 
 ' Add new connector. 
 .AddConnector(Type:=msoConnectorCurve, _ 
 BeginX:=0, BeginY:=0, EndX:=10, EndY:=10) _ 
 .Name = "Conn1To3" 
 
 ' Get connection site number of old shape, and set 
 ' reference to old shape. 
 With .Item("Conn1To2").ConnectorFormat 
 intSite = .EndConnectionSite 
 Set shpOld = .EndConnectedShape 
 End With 
 
 ' Connect new connector to old shape and new rectangle. 
 With .Item("Conn1To3").ConnectorFormat 
 .EndConnect ConnectedShape:=shpOld, _ 
 ConnectionSite:=intSite 
 .BeginConnect ConnectedShape:=shpNew, _ 
 ConnectionSite:=1 
 End With 
End With 

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應