GetCharacters

function GetCharacters(Start: number = null, Length: number = null): ApiCharacters

Description

Returns the ApiCharacters object that represents a range of characters within the object text. Use the ApiCharacters object to format characters within a text string.

Parameters

Startnumberdefault: null

The first character to be returned. If this argument is either 1 or omitted, this property returns a range of characters starting with the first character.

Lengthnumberdefault: null

The number of characters to be returned. If this argument is omitted, this property returns the remainder of the string (everything after the Start character).

Returns

ApiCharacters

Try It

var oWorksheet = Api.GetActiveSheet();
var oRange = oWorksheet.GetRange("B1");
oRange.SetValue("This is just a sample text.");
var oCharacters = oRange.GetCharacters(9, 4);
var oFont = oCharacters.GetFont();
oFont.SetBold(true);

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).