跳到主要内容

SetTopMargin

Sets the top margin of the sheet.

Syntax

expression.SetTopMargin(nPoints);

expression - A variable that represents a ApiWorksheet class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nPointsRequirednumberThe top margin size measured in points.

Returns

This method doesn't return any data.

Example

This example sets the top margin of the sheet.

var oWorksheet = Api.GetActiveSheet();
oWorksheet.SetTopMargin(25.1);
var nTopMargin = oWorksheet.GetTopMargin();
oWorksheet.GetRange("A1").SetValue("Top margin: " + nTopMargin + " mm");