Export (0) Print
Expand All
Expand Minimize

NamedRange.RowHeight Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets or sets the height of all the rows in the NamedRange control, measured in points.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

Object RowHeight { get; set; }

Property Value

Type: System.Object
The height of all the rows in the NamedRange control, measured in points. Returns null if the rows in the specified range are not all the same height.

For a single row, the value of the Height property is equal to the value of the RowHeight property. However, you can also use the Height property to return the total height of a range of cells.

Other differences between RowHeight and Height include the following:

  • Height is read-only.

  • If you return the RowHeight property of several rows, you will get either the row height of each of the rows (if all the rows are the same height) or null (if they are different heights). If you return the Height property of several rows, you will get the total height of all the rows.

The following code example creates a NamedRange and then sets the width of the columns and the height of the rows that are part of the range.

This example is for a document-level customization.

Microsoft.Office.Tools.Excel.NamedRange setColumnRowRange;
private void SetColumnAndRowSizes()
{
    setColumnRowRange = this.Controls.AddNamedRange(
        this.Range["C3", "E6"], "setColumnRowRange");
    this.setColumnRowRange.ColumnWidth = 20;
    this.setColumnRowRange.RowHeight = 25;
    setColumnRowRange.Select();
}

Show:
© 2014 Microsoft