ConnectorFormat.BeginConnectedShape プロパティ (Publisher)

指定されたコネクタの始点が接続されている図形を表す Shape オブジェクトを返します。

構文

BeginConnectedShape

ConnectorFormat オブジェクトを表す変数。

戻り値

Shape

注釈

指定したコネクタの始点が図形に接続されていない場合は、エラーが発生します。

コネクタの終点に接続される図形を取得するには、 EndConnectedShape プロパティを使用します。

次の使用例では、作業中の文書の最初のページに既に 2 つの図形があり、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 = .BeginConnectionSite 
 Set shpOld = .BeginConnectedShape 
 End With 
 
 ' Connect new connector to old shape and new rectangle. 
 With .Item("Conn1To3").ConnectorFormat 
 .BeginConnect ConnectedShape:=shpOld, _ 
 ConnectionSite:=intSite 
 .EndConnect ConnectedShape:=shpNew, _ 
 ConnectionSite:=1 
 End With 
End With 

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。