Shape.DeleteSection 方法 (Visio)
删除 ShapeSheet 内容。
语法
expression。 DeleteSection
( _Section_
)
表达 一个代表 Shape 对象的变量。
参数
名称 | 必需/可选 | 数据类型 | 说明 |
---|---|---|---|
Section | 必需 | Integer | 要删除的节的索引。 |
返回值
Nothing
注解
删除某一 ShapeSheet 内容时,该内容中的所有行都会自动被删除。 如果指定的内容不存在,将不会删除任何内容且不会产生错误。
如果删除了某一“Geometry”内容,则任何后续的“Geometry”内容都会向上移动,因为它们编制了索引,而索引范围内不允许有间隙。
除 visSectionObject 代表的内容外(但可以删除该内容中的行),可以删除任何内容。
节索引值在 VisSectionIndices 的 Visio 类型库中声明。
示例
下面的 Microsoft Visual Basic for Applications (VBA) 宏演示如何删除 ShapeSheet 内容。
Public Sub DeleteSection_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
'Delete the scratch section from the ShapeSheet.
vsoShape.DeleteSection visSectionScratch
End Sub
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈