跳到主要内容

SetReadingOrder

Sets the direction (reading order) of the text in the current cell range.

Syntax

expression.SetReadingOrder(direction);

expression - A variable that represents a ApiRange class.

Parameters

NameRequired/OptionalData typeDefaultDescription
directionRequired'context' | 'ltr' | 'rtl'The direction (reading order) that will be applied to the cell contents.

Returns

This method doesn't return any data.

Example

This example shows how to set the reading order of the text in the cell range.

const worksheet = Api.GetActiveSheet();
worksheet.GetRange("B2").SetValue("Hello, أهلاً, 你好");
const range = worksheet.GetRange("A1:C3");
range.SetReadingOrder('rtl');