SetUnderline

function SetUnderline(
  undelineType: none | single | singleAccounting | double | doubleAccounting = null,
): void

Description

Specifies that the contents of the current cell / cell range are displayed along with a line appearing directly below the character.

Parameters

undelineTypenone | single | singleAccounting | double | doubleAccountingdefault: null

Specifies the type of the line displayed under the characters. The following values are available: "none" - for no underlining; "single" - for a single line underlining the cell contents; "singleAccounting" - for a single line underlining the cell contents but not protruding beyond the cell borders; "double" - for a double line underlining the cell contents; "doubleAccounting" - for a double line underlining the cell contents but not protruding beyond the cell borders.

Returns

void

Try It

var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A2").SetValue("The text underlined with a single line");
oWorksheet.GetRange("A2").SetUnderline("single");
oWorksheet.GetRange("A4").SetValue("Normal text");

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).