HeightRule Property

Microsoft Word Visual Basic

Returns or sets the rule for determining the height of the specified frame. Read/write WdFrameSizeRule.

WdFrameSizeRule can be one of these WdFrameSizeRule constants.
wdFrameAtLeast
wdFrameExact
wdFrameAuto

expression.HeightRule

expression    Required. An expression that returns a Frame object.

ShowHeightRule property as it applies to the Cell, Cells, Row, and Rows objects.

Returns or sets the rule for determining the height of the specified cells or rows. Read/write WdRowHeightRule.

WdRowHeightRule can be one of these WdRowHeightRule constants.
wdRowHeightAtLeast
wdRowHeightExactly
wdRowHeightAuto

expression.HeightRule

expression    Required. An expression that returns one of the above objects.

Remarks

Setting the HeightRule property of a Cell or Cells object automatically sets the property for the entire row.

Example

ShowAs it applies to the Frame object.

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
				

ShowAs it applies to the Row object.

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
				

ShowAs it applies to the Rows object.

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