Shape.DeleteRow メソッド (Visio)

シェイプシートのセクションから行を削除します。

構文

expression. DeleteRow( _Section_ , _Row_ )

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

パラメーター

名前 必須 / オプション データ型 説明
Section 必須 Integer 行を含むセクションのインデックスです。
必須 Integer 削除する行のインデックスです。

戻り値

なし

解説

シェイプシートのセクションから行を 1 つずつ削除するには、DeleteRow メソッドを使用します。 セクションにインデックスの付いた行がある場合、削除された行の後にある行の位置が移動します。 行が存在しない場合は、何も削除されません。

ジオメトリ セクションの 1D エンドポイント行 (visRowXForm1D) やコンポーネント行 (visRowComponent) や MoveTo 行 (visRowVertex + 0) など、図形の基本的な特性を定義する行は削除しないでください。 visSectionCharactervisSectionParagraph、および visSectionTab で指定されているセクションの行を削除することはできません。

次の Microsoft Visual Basic for Applications (VBA) マクロは、DeleteRow メソッドを使用して、シェイプシートの行を削除する方法を示します。

Public Sub DeleteRow_Example() 
 
 Dim vsoPage As Visio.Page 
 Dim vsoShape As Visio.Shape 
 
 'Get the active page. 
 Set vsoPage = ActivePage 
 
 'If there isn't an active page, set the Page object 
 'to the first page of the active document. 
 If vsoPage Is Nothing Then 
 Set vsoPage = ActiveDocument.Pages(1) 
 End If 
 
 'Draw a rectangle on the active page. 
 Set vsoShape = vsoPage.DrawRectangle(1, 5, 5, 1) 
 
 'Add a scratch section to the ShapeSheet of the rectangle. 
 vsoShape.AddSection visSectionScratch 
 
 'Add a row to the scratch section. 
 vsoShape.AddRow visSectionScratch, visRowScratch, 0 
 
 'Delete the row from the scratch section. 
 vsoShape.DeleteRow visSectionScratch, visRowScratch 
 
End Sub

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

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