Skip to main content

SetSpacing

Sets the text spacing measured in twentieths of a point.

Syntax

expression.SetSpacing(nSpacing);

expression - A variable that represents a ApiTextPr class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nSpacingRequiredtwipsThe value of the text spacing measured in twentieths of a point (1/1440 of an inch).

Returns

ApiTextPr

Example

This example sets the text spacing measured in twentieths of a point.

let worksheet = Api.GetActiveSheet();
let fill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61));
let stroke = Api.CreateStroke(0, Api.CreateNoFill());
let shape = worksheet.AddShape("flowChartOnlineStorage", 120 * 36000, 70 * 36000, fill, stroke, 0, 2 * 36000, 0, 3 * 36000);
let content = shape.GetContent();
let paragraph = content.GetElement(0);
let run = Api.CreateRun();
let textProps = run.GetTextPr();
textProps.SetFontSize(30);
textProps.SetSpacing(80);
paragraph.SetJc("left");
run.AddText("This is a sample text inside the shape with the spacing set to 4 points (80 twentieths of a point).");
paragraph.AddElement(run);