InsertRows Method

Applies To

Selection object.

Description

Inserts the specified number of new rows above the row that contains the selection. If the selection isn't in a table, an error occurs.

Note You can also insert rows by using the Add method of the Rows object.

Syntax

expression.InsertRows(NumRows)

expression   An expression that returns a Selection object.

NumRows   Optional Variant. The number of rows to be added.

See Also

InsertCells method, InsertColumns method.

Example

This example inserts two new rows above the row that contains the selection, and then it removes the borders from the new rows.

If Selection.Information(wdWithInTable) = True Then
    Selection.InsertRows NumRows:=2
    Selection.Borders.Enable =False
End If