Skip to main content

CreateWordArt

Creates a Text Art object with the parameters specified.

Syntax

expression.CreateWordArt(textPr, text, transform, fill, stroke, rotAngle, width, height);

expression - A variable that represents a Api class.

Parameters

NameRequired/OptionalData typeDefaultDescription
textPrOptionalApiTextPrApi.CreateTextPr()The text properties.
textOptionalstring"Your text here"The text for the Text Art object.
transformOptionalTextTransform"textNoShape"Text transform type.
fillOptionalApiFillApi.CreateNoFill()The color or pattern used to fill the Text Art object.
strokeOptionalApiStrokeApi.CreateStroke(0, Api.CreateNoFill())The stroke used to create the Text Art object shadow.
rotAngleOptionalnumber0Rotation angle.
widthOptionalEMU1828800The Text Art width measured in English measure units.
heightOptionalEMU1828800The Text Art heigth measured in English measure units.

Returns

ApiDrawing

Example

Create a Text Art object with the "textArchUp" text transform type.

// Create a Text Art object using the specified text properties in a document.

// Create the empty text properties object and set the bold property, font size, capitalized letters, color, and font family to it in a document.

let doc = Api.GetDocument();
let textPr = Api.CreateTextPr();
textPr.SetFontSize(30);
textPr.SetBold(true);
textPr.SetCaps(true);
textPr.SetColor(Api.HexColor('#333333'));
textPr.SetFontFamily("Comic Sans MS");
let fill = Api.CreateSolidFill(Api.RGB(255, 111, 61));
let stroke = Api.CreateStroke(1 * 36000, Api.CreateSolidFill(Api.RGB(51, 51, 51)));
let textArt = Api.CreateWordArt(textPr, "onlyoffice", "textArchUp", fill, stroke, 0, 150 * 36000, 50 * 36000);
let paragraph = doc.GetElement(0);
paragraph.AddDrawing(textArt);