Skip to content

Latest commit

 

History

History
63 lines (40 loc) · 1.63 KB

Word.Row.md

File metadata and controls

63 lines (40 loc) · 1.63 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Row object (Word)
vbawd10.chm2384
vbawd10.chm2384
Word.Row
38a05858-829a-ea5c-ce63-7f7343bf7b88
06/08/2017
medium

Row object (Word)

Represents a row in a table. The Row object is a member of the Rows collection. The Rows collection includes all the rows in the specified selection, range, or table.

Remarks

Use Rows (Index), where Index is the index number, to return a single Row object. The index number represents the position of the row in the selection, range, or table. The following example deletes the first row in the first table in the active document.

ActiveDocument.Tables(1).Rows(1).Delete

Use the Add method to add a row to a table. The following example inserts a row before the first row in the selection.

If Selection.Information(wdWithInTable) = True Then 
 Selection.Rows.Add BeforeRow:=Selection.Rows(1) 
End If

Use the Cells property to modify the individual cells in a Row object. The following example adds a table to the selection and then inserts numbers into each cell in the second row of the table.

Selection.Collapse Direction:=wdCollapseEnd 
If Selection.Information(wdWithInTable) = False Then 
 Set myTable = _ 
 ActiveDocument.Tables.Add(Range:=Selection.Range, _ 
 NumRows:=3, NumColumns:=5) 
 For Each aCell In myTable.Rows(2).Cells 
 i = i + 1 
 aCell.Range.Text = i 
 Next aCell 
End If

See also

Word Object Model Reference

[!includeSupport and feedback]