Skip to main content

CreateWordArt

Creates a Text Art object with the parameters specified.

Syntax

expression.CreateWordArt(oTextPr, sText, sTransform, oFill, oStroke, nRotAngle, nWidth, nHeight, nIndLeft, nIndTop);

expression - A variable that represents a Api class.

Parameters

NameRequired/OptionalData typeDefaultDescription
oTextPrOptionalApiTextPrApi.CreateTextPr()The text properties.
sTextOptionalstring"Your text here"The text for the Text Art object.
sTransformOptionalTextTransform"textNoShape"Text transform type.
oFillOptionalApiFillApi.CreateNoFill()The color or pattern used to fill the Text Art object.
oStrokeOptionalApiStrokeApi.CreateStroke(0, Api.CreateNoFill())The stroke used to create the Text Art object shadow.
nRotAngleOptionalnumber0Rotation angle.
nWidthOptionalEMU1828800The Text Art width measured in English measure units.
nHeightOptionalEMU1828800The Text Art heigth measured in English measure units.
nIndLeftOptionalEMUApiPresentation.GetWidth() / 2The Text Art left side indentation value measured in English measure units.
nIndTopOptionalEMUApiPresentation.GetHeight() / 2The Text Art top side indentation value measured in English measure units.

Returns

ApiDrawing

Example

This example creates a Text Art object with the "textArchUp" text transform type.

// How to create word art indicating its text properties.

// Add arch up text word art.

const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
slide.RemoveAllObjects();

const run = Api.CreateRun();
const textPr = run.GetTextPr();
textPr.SetFontSize(72);
textPr.SetBold(true);
textPr.SetCaps(true);
textPr.SetColor(51, 51, 51, false);
textPr.SetFontFamily("Comic Sans MS");
const fill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61));
const stroke = Api.CreateStroke(1 * 36000, Api.CreateSolidFill(Api.CreateRGBColor(51, 51, 51)));
const textArt = Api.CreateWordArt(textPr, "onlyoffice", "textArchUp", fill, stroke, 0, 100 * 36000, 30 * 36000);
slide.AddObject(textArt);