Table of contents
TOC
Collapse the table of content
Expand the table of content

Shape.RowType Property (Visio)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Gets or sets the type of a row in a Geometry, Connection Points, Controls, or Tabs ShapeSheet section. Read/write.

Syntax

expression . RowType( Section , Row )

expression A variable that represents a Shape object.

Parameters

NameRequired/OptionalData TypeDescription
SectionRequiredIntegerThe index of the section that contains the row.
RowRequiredIntegerThe index of the row.

Return Value

Integer

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.

You can specify the type of row you want by setting RowType equal to any of the following constants declared by the Visio type library in member VisRowTags .

ConstantValue
visTagComponent137
visTagMoveTo138
visTagLineTo139
visTagArcTo140
visTagInfiniteLine141
visTagEllipse143
visTagEllipticalArcTo144
visTagSplineBeg165
visTagSplineSpan166
visTagPolylineTo193
visTagNURBSTo195
visTagTab0136
visTagTab2150
visTagTab10151
visTagTab60181
visTagCnnctPt153
visTagCnnctNamed185
visTagCtlPt162
visTagCtlPtTip170

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
© 2017 Microsoft