HeightRule Property Example

This example creates a 3x3 table in a new document and then sets a minimum row height of 24 points for the second row.

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

This example sets the height rule for the selected rows to automatically adjust to the tallest cell in the row.

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

This example sets both the height and width of the first frame in the active document to exactly 1 inch.

If ActiveDocument.Frames.Count >= 1 Then
    With ActiveDocument.Frames(1)
        .HeightRule = wdFrameExact
        .Height = InchesToPoints(1)
        .WidthRule = wdFrameExact
        .Width = InchesToPoints(1)
    End With
End If