Export (0) Print
Expand All
Expand Minimize

NamedRange.ReadingOrder Property

Gets or sets the reading order for the NamedRange control.

Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in microsoft.office.tools.excel.dll)

public int ReadingOrder { get; set; }

Property Value

One of the following values: xlRTL (right-to-left), xlLTR (left-to-right), or xlContext.

Some of these constants might not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.

The following code example uses the ReadingOrder property to reverse the reading order of a NamedRange, if the current language that is selected or installed supports it.

Microsoft.Office.Tools.Excel.NamedRange readingOrderRange;
private void ReverseReadingOrder()
{
    readingOrderRange = this.Controls.AddNamedRange(
         this.Range["C1", missing], "readingOrderRange");
    if (this.readingOrderRange.ReadingOrder ==
        (int)Excel.Constants.xlRTL)
    {
        this.readingOrderRange.ReadingOrder =
            (int)Excel.Constants.xlLTR;
    }
    else
    {
        this.readingOrderRange.ReadingOrder =
            (int)Excel.Constants.xlRTL;
    }
}

Show:
© 2014 Microsoft