跳到主要内容

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'

Returns

boolean

Example

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

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