# Format related procedures in class Row (Word VBA)

This page presents procedures from class Row related to the theme Format: Borders, HeadingFormat, HeightRule, SetHeight, Rows.Borders, Rows.DistributeHeight, Rows.HeadingFormat, Rows.HeightRule and Rows.SetHeight

## Borders

Returns a Borders collection that represents all the borders for the specified object.

For information about returning a single member of a collection, see Returning an object from a collection.

```
ActiveDocument.Range.Rows(1).Borders =
```

## HeadingFormat

True if the specified row or rows are formatted as a table heading. Rows formatted as table headings are repeated when a table spans more than one page. Can be True, False or wdUndefined.

```
Dim rngTemp As Range
Dim tableNew As Table
Set rngTemp = ActiveDocument.Range(0, 0)
Set tableNewe = ActiveDocument.Tables.Add(rngTemp, 5, 5)
tableNew.Rows(1).HeadingFormat = True
```

## HeightRule

Returns or sets the rule for determining the height of the specified cells or rows.

Possible Values are**wdRowHeightAtLeast**- The row height is at least a minimum specified value,

**wdRowHeightAuto**- The row height is adjusted to accommodate the tallest value in the row,

**wdRowHeightExactly**- The row height is an exact value.

```
Set newDoc = Documents.Add
Set myTable = newDoc.Tables.Add(Range:=Selection.Range, _
NumRows:=3, NumColumns:=3)
With myTable.Rows(2)
.Height = 24
.HeightRule = wdRowHeightAtLeast
End With
```

## SetHeight

Sets the height of a table row.

Syntax : *expression*.**SetHeight** (RowHeight, HeightRule)

```
Set newDoc = Documents.Add
Set aTable = _
newDoc.Tables.Add(Range:=Selection.Range, NumRows:=3, _
NumColumns:=3)
aTable.Rows(1).SetHeight RowHeight:=InchesToPoints(0.5), _
HeightRule:=wdRowHeightExactly
```

### Arguments

The following arguments are required:

RowHeight (Single) - The height of the row, in points.

HeightRule (WdRowHeightRule) - The rule for determining the height of the specified rows.

Possible Values are**wdRowHeightAtLeast**- The row height is at least a minimum specified value,

**wdRowHeightAuto**- The row height is adjusted to accommodate the tallest value in the row,

**wdRowHeightExactly**- The row height is an exact value.

## Rows.Borders

Returns a Borders collection that represents all the borders for the specified object.

For information about returning a single member of a collection, see Returning an object from a collection.

```
Set myTable = ActiveDocument.Tables(1)
With myTable.Rows.Borders
.InsideLineStyle = wdLineStyleSingle
.OutsideLineStyle = wdLineStyleDouble
End With
```

## Rows.DistributeHeight

Adjusts the height of the specified rows or cells so that they're equal.

```
ActiveDocument.Tables(1).Rows.DistributeHeight
```

## Rows.HeadingFormat

True if the specified row or rows are formatted as a table heading.

Rows formatted as table headings are repeated when a table spans more than one page. Can be True, False or wdUndefined.

```
Dim rngTemp As Range
Dim tableNew As Table
Set rngTemp = ActiveDocument.Range(0, 0)
Set tableNewe = ActiveDocument.Tables.Add(rngTemp, 5, 5)
tableNew.Rows.HeadingFormat = True
```

## Rows.HeightRule

Returns or sets the rule for determining the height of the specified cells or rows.

Possible Values are**wdRowHeightAtLeast**- The row height is at least a minimum specified value,

**wdRowHeightAuto**- The row height is adjusted to accommodate the tallest value in the row,

**wdRowHeightExactly**- The row height is an exact value.

```
If Selection.Information(wdWithInTable) = True Then
Selection.Rows.HeightRule = wdRowHeightAuto
Else
MsgBox "The insertion point is not in a table."
End If
```

## Rows.SetHeight

Sets the height of table rows.

Syntax : *expression*.**SetHeight** (RowHeight, HeightRule)

```
Set newDoc = Documents.Add
Set aTable = _
newDoc.Tables.Add(Range:=Selection.Range, NumRows:=3, _
NumColumns:=3)
aTable.Rows.SetHeight RowHeight:=InchesToPoints(0.5), _
HeightRule:=wdRowHeightExactly
```

### Arguments

The following arguments are required:

RowHeight (Single) - The height of the row or rows, in points.

HeightRule (WdRowHeightRule) - The rule for determining the height of the specified rows.

Possible Values are**wdRowHeightAtLeast**- The row height is at least a minimum specified value,

**wdRowHeightAuto**- The row height is adjusted to accommodate the tallest value in the row,

**wdRowHeightExactly**- The row height is an exact value.