Shape.DeleteRow 方法 (Visio)
从 ShapeSheet 电子表格的内容中删除行。
语法
expression。 DeleteRow
( _Section_
, _Row_
)
表达 一个代表 Shape 对象的变量。
参数
名称 | 必需/可选 | 数据类型 | 说明 |
---|---|---|---|
Section | 必需 | Integer | 包含该行的内容的索引。 |
行 | 必需 | Integer | 要删除的行的索引。 |
返回值
Nothing
注解
要一次从 ShapeSheet 内容中删除一行,请使用 DeleteRow 方法。 如果该内容具有索引行,被删除的行的后续行将调整位置。 如果要删除的行并不存在,将不会删除任何内容。
不应删除定义形状的基本特征的行,例如“1D Endpoints”行 (visRowXForm1D) 或组件行 (visRowComponent) 或 Geometry 节中的 moveTo 行 (visRowVertex + 0) 。 不能从 visSectionCharacter、visSectionParagraph 和 visSectionTab 表示的内容中删除行。
示例
下面的 Microsoft Visual Basic for Applications (VBA) 宏演示如何使用 DeleteRow 方法删除 ShapeSheet 行。
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 支持和反馈,获取有关如何接收支持和提供反馈的指南。