NativeExcel2 for .Net Developer's Reference

IRange.Orientation Property

Gets or sets the text orientation for the specified range.

[Visual Basic]
PropertyOrientationAsInteger
[C#]
intOrientation{get;set;}
[C++]
__propertyintget_Orientation();
__propertyvoidset_Orientation(int);
[JScript]
functiongetOrientation():int
functionsetOrientation(int);

Property Value

Can be an integer value from -90 to 90 degrees or one of the XlOrientation values.

Example

This example sets orientation property for the merged ranges A1:A5 and B1:B5

[C#]
 IRange range;
 range = book.Worksheets[1].Range["A1:A5"];
 range.Merge();
 range.Value = "Text";
 range.Orientation = 90;

 range = book.Worksheets[1].Range["B1:B5"];
 range.Merge();
 range.Value = "Vertical";
 range.Orientation = XlOrientation.xlVertical;
[VisualBasic]
 Dim range As IRange
 range = book.Worksheets(1).Range("A1:A5")
 range.Merge()
 range.Value = "Text"
 range.Orientation = 90

 range = book.Worksheets(1).Range("B1:B5")
 range.Merge()
 range.Value = "Vertical"
 range.Orientation = XlOrientation.xlVertical
[C++]
 IRange* range;
 range = book->Worksheets->Item[1]->Range->Item[S"A1:A5"];
 range->Merge();
 range->Value = S"Text";
 range->Orientation = 90;

 range = book->Worksheets->Item[1]->Range->Item[S"B1:B5"];
 range->Merge();
 range->Value = S"Vertical";
 range->Orientation = XlOrientation::xlVertical;

See Also

IRange Interface | NativeExcel Namespace | XlOrientation Class