Excel) (Shape.ConnectionSiteCount 屬性

會傳回指定之圖案上連接位置的數目。 唯讀的 Long

語法

運算式ConnectionSiteCount

表達 會傳回 Shape 物件的運算式。

範例

這個範例會在 myDocument 中新增兩個矩形,然後用兩條連接線將這兩個矩形連接起來。 兩條連接線的起點都連接在第一個矩形的第一個連接位置上;而兩條連接線的終點則分別連線在第二個矩形的第一個和最後一個連接位置上。

Set myDocument = Worksheets(1) 
Set s = myDocument.Shapes 
Set firstRect = s.AddShape(msoShapeRectangle, _ 
 100, 50, 200, 100) 
Set secondRect = s.AddShape(msoShapeRectangle, _ 
 300, 300, 200, 100) 
lastsite = secondRect.ConnectionSiteCount 
With s.AddConnector(msoConnectorCurve, _ 
 0, 0, 100, 100).ConnectorFormat 
 .BeginConnect ConnectedShape:=firstRect, _ 
 ConnectionSite:=1 
 .EndConnect ConnectedShape:=secondRect, _ 
 ConnectionSite:=1 
End With 
With s.AddConnector(msoConnectorCurve, _ 
 0, 0, 100, 100).ConnectorFormat 
 .BeginConnect ConnectedShape:=firstRect, _ 
 ConnectionSite:=1 
 .EndConnect ConnectedShape:=secondRect, _ 
 ConnectionSite:=lastsite 
End With

支援和意見反應

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