次の方法で共有


Connects.ToSheet プロパティ (Visio)

1 つまたは複数の接続先となっている図形を返します。 読み取り専用です。

構文

ToSheet

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

戻り値

Shape

注釈

Connect オブジェクトの ToSheet プロパティは、常に接続先の図形を返します。

Connects コレクションは複数の接続を表します。 コレクションで表されるすべての接続が同じ図形に接続している場合、ToSheet プロパティはその図形を返します。 それ以外の場合は Nothing を返し、例外は発生しません。

この Microsoft Visual Basic for Applications (VBA) マクロは、ToSheet プロパティを使用して、Microsoft Visio 図面から、Connect オブジェクトの接続元である図形を検索します。 この例では、接続情報はイミディエイト ウィンドウに表示されます。

この例は、接続された図形を少なくとも 2 つ含むアクティブな図面があることを前提としています。 [組織図] ステンシルの図形を 2 つ接続すると、最適な結果を得ることができます。

 
Public Sub ToSheet_Example() 
 
 Dim vsoShapes As Visio.Shapes 
 Dim vsoShape As Visio.Shape 
 Dim vsoConnectTo As Visio.Shape 
 Dim vsoConnects As Visio.Connects 
 Dim vsoConnect As Visio.Connect 
 Dim intCurrentShapeIndex As Integer 
 Dim intCounter As Integer 
 Set vsoShapes = ActivePage.Shapes 
 
 'For each shape on the page, get its connections. 
 For intCurrentShapeIndex = 1 To vsoShapes.Count 
 
 Set vsoShape = vsoShapes(intCurrentShapeIndex) 
 Set vsoConnects = vsoShape.Connects 
 
 'For each connection, get the shape it connects to. 
 For intCounter = 1 To vsoConnects.Count 
 
 Set vsoConnect = vsoConnects(intCounter) 
 Set vsoConnectTo = vsoConnect.ToSheet 
 
 'Print the name of the shape the 
 'Connect object connects to. 
 Debug.Print vsoConnectTo.Name 
 
 Next intCounter 
 
 Next intCurrentShapeIndex 
 
End Sub

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

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