Shape.RowType 属性 (Visio)
获取或设置“Geometry”、“Connection Points”、“Controls”或“Tabs ShapeSheet”内容中行的类型。 读/写。
语法
表达式。RowType (节、 行)
表达 一个代表 Shape 对象的变量。
参数
名称 | 必需/可选 | 数据类型 | 说明 |
---|---|---|---|
Section | 必需 | Integer | 包含该行的内容的索引。 |
行 | 必需 | Integer | 行的索引。 |
返回值
整数
备注
更改行类型后,新的行类型可能包含相同单元格,也可能不包含。 程序必须为新建单元格或已更改单元格提供适当的公式。
通过将 RowType 设置为等于下列由 Visio 类型库在 VisRowTags 成员中声明的任一常量,您可以指定行的类型。
常量 | 值 |
---|---|
visTagComponent | 137 |
visTagMoveTo | 138 |
visTagLineTo | 139 |
visTagArcTo | 140 |
visTagInfiniteLine | 141 |
visTagEllipse | 143 |
visTagEllipticalArcTo | 144 |
visTagSplineBeg | 165 |
visTagSplineSpan | 166 |
visTagPolylineTo | 193 |
visTagNURBSTo | 195 |
visTagTab0 | 136 |
visTagTab2 | 150 |
visTagTab10 | 151 |
visTagTab60 | 181 |
visTagCnnctPt | 153 |
visTagCnnctNamed | 185 |
visTagCtlPt | 162 |
visTagCtlPtTip | 170 |
如果传递的行标记不合适或者行不存在,则不会发生任何更改并且返回一个错误。
使用 RowName 属性将未命名的 Connection Points 行转换为已命名的 Connection Points 行。
有关有效行常量的列表,请参阅 VisRowIndices ;有关有效行标记常量的列表 ,请参阅 VisRowIndices 。
有关有效节常量的列表,请参阅 VisSectionIndices 。
示例
以下 Microsoft Visual Basic for Applications (VBA) 宏显示如何使用 RowType 属性更改 ShapeSheet 行的类型。 该宏在页面上绘制一个矩形,然后通过将该形状的线条更改为弧形使矩形的线条成为弓形或曲线。 其方法是将矩形各边的 ShapeSheet 行类型由 LineTo 更改为 ArcTo,然后更改各行中的 X 和 Y 单元格的值。
Public Sub RowType_Example()
Dim vsoPage As Visio.Page
Dim vsoShape As Visio.Shape
Dim vsoCell As Visio.Cell
Dim strBowCell As String
Dim strBowFormula As String
Dim intCounter As Integer
'Set the value of the strBowCell string.
strBowCell = "Scratch.X1"
'Set the value of the strBowFormula string.
strBowFormula = "=Min(Width, Height) / 5"
Set vsoPage = ActivePage
'If there isn't an active page, set vsoPage
'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 and add a row to the scratch section.
vsoShape.AddSection visSectionScratch
vsoShape.AddRow visSectionScratch, visRowScratch, 0
'Set vsoCell to the Scratch.X1 cell and set its formula.
Set vsoCell = vsoShape.Cells(strBowCell)
vsoCell.formula = strBowFormula
'Bow in or curve the rectangle's lines by changing
'each row type from LineTo to ArcTo and entering the bow value.
For intCounter = 1 To 4
vsoShape.RowType(visSectionFirstComponent, visRowVertex + intCounter) = visTagArcTo
Set vsoCell = vsoShape.CellsSRC(visSectionFirstComponent, visRowVertex + intCounter, 2)
vsoCell.formula = "-" & strBowCell
Next intCounter
End Sub
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈