Rows.Add method (Publisher)

Adds a new Row object to the specified Rows collection and returns the new Row object.

Syntax

expression.Add (BeforeRow)

expression A variable that represents a Rows object.

Parameters

Name Required/Optional Data type Description
BeforeRow Optional Long The number of the row before which to insert the new row. If this argument is omitted, the new row is added after the existing rows. An error occurs if the value of this argument does not correspond to an existing row in the table.

Return value

Row

Example

The following example adds a row before row three in the specified table.

Dim rowNew As Row 
 
Set rowNew = ActiveDocument.Pages(1).Shapes(1) _ 
 .Table.Rows.Add(BeforeRow:=3)

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.