AddRows method

Microsoft Visio Developer Reference

AddRows method

   Example   

Adds the specified number of rows to a ShapeSheet section at a specified position.

Version added

4.0

Syntax

retVal = object.AddRows (section, row, tag, count)

retVal

Integer. The row number of the last row that was added.

object

Required. An expression that returns a Shape object.

section

Required Integer. The section in which to add the rows.

row

Required Integer. The position at which to add the rows.

tag

Required Integer. The type of rows to add.

count

Required Integer. The number of rows to add.

Remarks

If the ShapeSheet section does not exist, the AddRows method creates a section with blank rows. New cells in new rows are initialized with default formulas, if applicable. Otherwise, a program must include statements to set the formulas for the new cells. An error occurs if the row cannot be added.

The row constants declared by the Visio type library serve as base positions at which a section's rows begin. Add offsets to these constants to specify the first row and beyond, for example, visRowFirst+0, visRowFirst+1, and so on. To add rows at the end of a section, pass the constant visRowLast for the row argument. The value returned is the actual row index.

The tag argument specifies the type of rows to add. Pass zero (0) as the tag argument to generate a section's default row type. Explicit tags are useful when adding rows to Geometry, Connection Points, and Controls sections. See the RowType property for descriptions of valid row types for these sections. Passing an invalid row type generates an error.

If you try to add rows to a Character, Tabs, or Paragraph section, an error occurs.

The AddRows method cannot add named rows; an error occurs if the section contains named rows or can hold only named rows. To add named rows, use the AddNamedRow method.

The Visio type library declares the constants for tag in VisRowIndices.

Click to show or hide information.Valid constants for tag

Constant

Value

Description

visRowFirst

0

Row logically before every row in a section.

visRowLast

-2

Row logically after every row in a section.

visRowNone

-1

Unspecified row.

visRow1stHyperlink

0

Index of first row in visSectionHyperlink.

visRowAction

0

Index of first row in visSectionAction.

visRowCharacter

0

Index of first row in visSectionCharacter.

visRowComponent

0

Index of component properties row in a Geometry section (visSectionFirstComponent+i).

visRowConnectionPts

0

Index of first row in visSectionConnectionPts.

visRowControl

0

Index of first row in visSectionControl.

visRowField

0

Index of first row in visSectionTextField.

visRowLayer

0

Index of first row in visSectionLayer.

visRowParagraph

0

Index of first row in visSectionParagraph.

visRowProp

0

Index of first row in visSectionProp.

visRowScratch

0

Index of first row in visSectionScratch.

visRowTab

0

Index of first row in visSectionTab.

visRowUser

0

Index of first row in visSectionUser.

visRowXFormOut

1

Index of row in visSectionObject that defines the shape's transform properties.

visRowVertex

1

Index of first vertex row in a Geometry section.

visRowLine

2

Index of row in visSectionObject that defines line properties.

visRowFill

3

Index of row in visSectionObject that defines fill properties.

visRowXForm1D

4

Index of row in 1-D shape's visSectionObject that defines its endpoints.

visRowEvent

5

Index of row in visSectionObject that contains event information.

visRowLayerMem

6

Index of row in visSectionObject that defines what layers the shape belongs to.

visRowStyle

8

Index of row in visSectionObject that defines style properties.

visRowForeign

9

Index of row in visSectionObject that defines foreign properties (shape of type visTypeForeignObject).

visRowPage

10

Index of row in visSectionObject that defines page or master properties (shape of type visTypePage).

visRowText

11

Index of row in visSectionObject that defines shape or style's text block properties.

visRowTextXForm

12

Index of row in visSectionObject that defines shape's text transform properties.

visRowAlign

14

Index of row in visSectionObject that defines the shape's alignment.

visRowLock

15

Index of row in visSectionObject that defines its lock properties.

visRowHelpCopyright

16

Index of row in visSectionObject that defines help and copyright properties.

visRowMisc

17

Index of row in visSectionObject that defines miscellaneous behaviors.

visRowRulerGrid

18

Index of row in visSectionObject of page or master that defines ruler and grid settings.

visRowDoc

20

Index of row in visSectionObject that contains document properties.

visRowImage

21

Index of row in visSectionObject that defines image properties (shape whose ForeignType property is visTypeBitMap).

visRowGroup

22

Index of row in visSectionObject that defines foreign properties (shape of type visTypeGroup).

visRowShapeLayout

23

Index of row in visSectionObject of shape that defines placement and routing.

visRowPageLayout

24

Index of row in visSectionObject of page or master that defines placement and routing.