AddWordArt

function AddWordArt(
  oTextPr: ApiTextPr = Api.CreateTextPr(),
  sText: string = "Your text here",
  sTransform: TextTransform = "textNoShape",
  oFill: ApiFill = Api.CreateNoFill(),
  oStroke: ApiStroke = Api.CreateStroke(0, Api.CreateNoFill()),
  nRotAngle: number = 0,
  nWidth: EMU = 1828800,
  nHeight: EMU = 1828800,
  nFromCol: number = 0,
  nFromRow: number = 0,
  nColOffset: EMU = 0,
  nRowOffset: EMU = 0,
): ApiDrawing

Description

Adds a Text Art object to the current sheet with the parameters specified.

Parameters

oTextPrApiTextPrdefault: Api.CreateTextPr()

The text properties.

sTextstringdefault: "Your text here"

The text for the Text Art object.

sTransformTextTransformdefault: "textNoShape"

Text transform type.

oFillApiFilldefault: Api.CreateNoFill()

The color or pattern used to fill the Text Art object.

oStrokeApiStrokedefault: Api.CreateStroke(0, Api.CreateNoFill())

The stroke used to create the Text Art object shadow.

nRotAnglenumberdefault: 0

Rotation angle.

nWidthEMUdefault: 1828800

The Text Art width measured in English measure units.

nHeightEMUdefault: 1828800

The Text Art heigth measured in English measure units.

nFromColnumberdefault: 0

The column number where the beginning of the Text Art object will be placed.

nFromRownumberdefault: 0

The row number where the beginning of the Text Art object will be placed.

nColOffsetEMUdefault: 0

The offset from the nFromCol column to the left part of the Text Art object measured in English measure units.

nRowOffsetEMUdefault: 0

The offset from the nFromRow row to the upper part of the Text Art object measured in English measure units.

Returns

ApiDrawing

Try It

var oWorksheet = Api.GetActiveSheet();
var oTextPr = Api.CreateTextPr();
oTextPr.SetFontSize(72);
oTextPr.SetBold(true);
oTextPr.SetCaps(true);
oTextPr.SetColor(51, 51, 51, false);
oTextPr.SetFontFamily("Comic Sans MS");
var oFill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61));
var oStroke = Api.CreateStroke(1 * 36000, Api.CreateSolidFill(Api.CreateRGBColor(51, 51, 51)));
oWorksheet.AddWordArt(oTextPr, "onlyoffice", "textArchUp", oFill, oStroke, 0, 100 * 36000, 20 * 36000, 0, 2, 2 * 36000, 3 * 36000);

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