跳到主要内容

SetLocale

设置文档的区域设置。

语法

expression.SetLocale(LCID);

expression - 表示 Api 类的变量。

参数

名称必需/可选数据类型默认值描述
LCID必需number指定的区域设置。

返回值

此方法不返回任何数据。

示例

此示例设置文档的区域设置。

// How to set a region to the document.

// Set or change the locale of the document.

let worksheet = Api.GetActiveSheet();
Api.SetLocale("en-CA");
worksheet.GetRange("A1").SetValue("A sample spreadsheet with the language set to English (Canada).");