跳到主要内容

SetTopMargin

设置上边距的大小。

语法​

expression.SetTopMargin(nMargin);

expression - 表示 ApiPageSetup 类的变量。

参数​

名称必需/可选数据类型默认值描述
nMargin必需number以毫米为单位的上边距大小。

返回值​

boolean

示例​

在电子表格中为工作表定义上页边距。

// How do I set the top margin of a worksheet for printing in a spreadsheet?

// Adjust the spacing on the top side of the printed page in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let pageSetup = worksheet.GetPageSetup();
pageSetup.SetTopMargin(20);