跳到主要内容

SetAlignVertical

Sets the vertical alignment of the text in the current cell range.

Syntax

expression.SetAlignVertical(sAligment);

expression - A variable that represents a ApiRange class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sAligmentRequired'center' | 'bottom' | 'top' | 'distributed' | 'justify'The vertical alignment that will be applied to the cell contents.

Returns

boolean

Example

This example sets the vertical alignment of the text in the cell range.

let worksheet = Api.GetActiveSheet();
let range = worksheet.GetRange("A1:D5");
worksheet.GetRange("A2").SetValue("This is just a sample text distributed in the A2 cell.");
range.SetAlignVertical("distributed");