NativeExcel for .Net Developer's Reference

IRange.VerticalAlignment Property

Gets or sets the vertical alignment for the specified range.

[Visual Basic]
PropertyVerticalAlignmentAsXlVAlign
[C#]
XlVAlignVerticalAlignment{get;set;}
[C++]
__propertyXlVAlignget_VerticalAlignment();
__propertyvoidset_VerticalAlignment(XlVAlign);
[JScript]
functiongetVerticalAlignment():XlVAlign
functionsetVerticalAlignment(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;
[VisualBasic]
 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