다음을 통해 공유


NamedRange.ReadingOrder Property

Definition

Gets or sets the reading order for the NamedRange control.

public:
 property int ReadingOrder { int get(); void set(int value); };
public int ReadingOrder { get; set; }
member this.ReadingOrder : int with get, set
Public Property ReadingOrder As Integer

Property Value

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

Examples

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.

This example is for a document-level customization.

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

Private Sub ReverseReadingOrder()
    readingOrderRange = Me.Controls.AddNamedRange( _
        Me.Range("C1"), "readingOrderRange")
    If Me.readingOrderRange.ReadingOrder = _
        Fix(Excel.Constants.xlRTL) Then
        Me.readingOrderRange.ReadingOrder = _
            Fix(Excel.Constants.xlLTR)
    Else
        Me.readingOrderRange.ReadingOrder = _
            Fix(Excel.Constants.xlRTL)
    End If
End Sub

Remarks

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.

Applies to