SetTabs
Specifies a sequence of custom tab stops which will be used for any tab characters in the current paragraph. -Warning: The lengths of aPos array and aVal array -MUST BE equal to each other.
Syntax
expression.SetTabs(aPos, aVal);
expression - A variable that represents a ApiParaPr class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| aPos | Required | twips[] | An array of the positions of custom tab stops with respect to the current page margins measured in twentieths of a point (1/1440 of an inch). | |
| aVal | Required | TabJc[] | An array of the styles of custom tab stops, which determines the behavior of the tab stop and the alignment which will be applied to text entered at the current custom tab stop. |
Returns
boolean
Example
Set a sequence of custom tab stops which will be used for any tab characters in the paragraph in a spreadsheet.
// How to change sizes of tabs between paragraphs in a spreadsheet.
// Customize all kind of tabs indicating sizes 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", 150 * 36000, 70 * 36000, fill, stroke, 0, 2 * 36000, 0, 3 * 36000);
let content = shape.GetContent();
let paragraph = content.GetElement(0);
let paraPr = paragraph.GetParaPr();
paraPr.SetTabs([1440, 2880, 4320], ["left", "center", "right"]);
paragraph.AddTabStop();
paragraph.AddText("Custom tab - 1 inch left");
paragraph.AddLineBreak();
paragraph.AddTabStop();
paragraph.AddTabStop();
paragraph.AddText("Custom tab - 2 inches center");
paragraph.AddLineBreak();
paragraph.AddTabStop();
paragraph.AddTabStop();
paragraph.AddTabStop();
paragraph.AddText("Custom tab - 3 inches right");