AddRow method

Microsoft Visio Developer Reference

AddRow method

       

Adds a row to a ShapeSheet section at a specified position.

Version added

2.0

Syntax

retVal = object.AddRow (section, row, tag)

retVal

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

object

Required. An expression that returns a Shape object.

section

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

row

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

tag

Required Integer. The type of row to add.

Remarks

If the ShapeSheet section does not already exist, it is created with a blank row. 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 is generated if the new 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 row 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 a row to a Character, Tabs, or Paragraph section, an error occurs.

The AddRow 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 row constants prefixed with visRow in VisRowIndices. These are also listed in the AddRows method topic.

Constants for rows in the Geometry, Connection Points and Controls sections are prefixed with visTag and declared by the type library in VisRowTags. To see a list of these constants, see the RowType property.