Skip to main content

SetVerticalTextAlign

Sets the vertical alignment to the shape content where a paragraph or text runs can be inserted.

Syntax

expression.SetVerticalTextAlign(sVerticalAlign);

expression - A variable that represents a ApiShape class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sVerticalAlignRequired"top" | "center" | "bottom"The vertical alignment type for the shape inner contents.

Returns

boolean

Example

This example sets the vertical alignment to the shape content where a paragraph or text runs can be inserted.

let worksheet = Api.GetActiveSheet();
let fill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61));
let stroke = Api.CreateStroke(0, Api.CreateNoFill());
let shape = worksheet.AddShape("flowChartOnlineStorage", 60 * 36000, 50 * 36000, fill, stroke, 0, 2 * 36000, 0, 3 * 36000);
let content = shape.GetContent();
content.RemoveAllElements();
shape.SetVerticalTextAlign("bottom");
let paragraph = Api.CreateParagraph();
paragraph.SetJc("left");
paragraph.AddText("We removed all elements from the shape and added a new paragraph inside it ");
paragraph.AddText("aligning it vertically by the bottom.");
content.Push(paragraph);