NativeExcel for .Net Developer's Reference

IRange.VerticalAlignment Property

Gets or sets the vertical alignment for the specified range.

[Visual Basic]
Property VerticalAlignment As XlVAlign
[C#]
XlVAlign VerticalAlignment { get; set; }
[C++]
__property XlVAlign get_VerticalAlignment();
__property void set_VerticalAlignment(XlVAlign );
[JScript]
function get VerticalAlignment() : XlVAlign
function set VerticalAlignment(XlVAlign);

Property Value

One of the XlVAlign values.

Example

This example centers the contents of the row two vertically.

[C#]
 book.Worksheets[1].Range.Rows[2].VerticalAlignment = XlVAlign.xlVAlignCenter;
[Visual Basic]
 book.Worksheets(1).Range.Rows(2).VerticalAlignment = XlVAlign.xlVAlignCenter;
[C++]
 book->Worksheets->Item[1]->Range->Rows->Item[2]->VerticalAlignment = XlVAlign::xlVAlignCenter;

See Also

IRange Interface | NativeExcel Namespace | XlVAlign Enumeration | HorizontalAlignment Property