Skip to main content

GetSpacingLineRule

Returns the paragraph line spacing rule.

Inherited from ApiParaPr.GetSpacingLineRule.

Syntax​

expression.GetSpacingLineRule();

expression - A variable that represents an ApiParagraph class.

Parameters​

This method doesn't have any parameters.

Returns​

"auto" | "atLeast" | "exact" | undefined

Example​

Read the rule that controls line spacing within a paragraph in a spreadsheet.

// How do I find out which line spacing mode is applied to a paragraph in a spreadsheet?

// Confirm the line spacing rule of a paragraph after setting it to a custom value in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let fill = Api.CreateSolidFill(Api.RGB(255, 111, 61));
let stroke = Api.CreateStroke(0, Api.CreateNoFill());
let shape = worksheet.AddShape("flowChartOnlineStorage", 120 * 36000, 80 * 36000, fill, stroke, 0, 2 * 36000, 0, 3 * 36000);
let content = shape.GetContent();
let paragraph = content.GetElement(0);
paragraph.SetSpacingLine(3 * 240, "auto");
paragraph.AddText("Paragraph 1. Spacing: 3 times of a common paragraph line spacing.");
paragraph.AddLineBreak();
paragraph.AddText("These sentences are used to add lines for demonstrative purposes. ");
paragraph.AddText("These sentences are used to add lines for demonstrative purposes. ");
paragraph.AddLineBreak();
let spacingRule = paragraph.GetSpacingLineRule();
paragraph.AddText("Spacing line rule: " + spacingRule);