Publisher) (ConnectorFormat.EndConnectedShape 屬性

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

語法

運算式。EndConnectedShape

運算式 代表 ConnectorFormat 物件的變數。

傳回值

圖形

註解

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

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

範例

此範例假設使用中出版物的第一頁已包含兩個由名為 Conn1To2 的連接器附加的圖形。 程式碼會在第一頁新增矩形和連接線。 新連接器的端點將與名為 Conn1To2 的連接器端點連接至相同的連接站點,而新連接器的開頭將貼附至新矩形上的連接站點 1。

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 支援與意見反應。