RowType Property [Visio 2003 SDK Documentation]
Gets or sets the type of a row in a Geometry, Connection Points, Controls, or Tabs ShapeSheet section.
retVal = object**.RowType** (section, row)**
object**.RowType** (section, row) = rowTag
retVal Integer. The current type of the row.
object Required. An expression that returns a Shape object.
section Required Integer. The index of the section that contains the row.
row Required Integer. The index of the row.
rowTag Required Integer. The new type for the row.
Version added
2.0
Remarks
After you change a row's type, the new row type may or may not have the same cells. Your program must provide the appropriate formulas for the new or changed cells.
The rowTag argument specifies the type of row you want. You can use any of the following constants declared by the Visio type library in member VisRowTags.
Constant | Value |
---|---|
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 |
If an inappropriate row tag is passed or the row does not exist, no changes occur and an error is returned.
Use the RowName property to transition from unnamed to named Connection Points rows.
See VisRowIndices for a list of valid row constants and VisRowTags for a list of valid row tag constants.
See VisSectionIndices for a list of valid section constants.
Example
This Microsoft Visual Basic for Applications (VBA) macro shows how to use the RowType property to change the type of a ShapeSheet row. It draws a rectangle on a page and bows, or curves, the lines of the rectangle by changing the shape's lines to arcs. This is accomplished by changing the ShapeSheet row types for each side of the rectangle from LineTo to ArcTo and then changing the values of the X and Y cells in each of these rows.
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
Applies to | Shape object
See Also | AddNamedRow method | AddRow method | AddSection method | Formula property