NamedRange.Orientation Property

Gets or sets the text orientation.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

Object Orientation { get; set; }

Property Value

Type: System.Object
An integer value in the range of -90 to 90 degrees.

The following code example creates a NamedRange and then uses the Orientation property to display vertical text in the NamedRange.

This example is for a document-level customization.


Microsoft.Office.Tools.Excel.NamedRange orientationRange;
private void DisplayVerticalText()
{
    orientationRange = this.Controls.AddNamedRange(
         this.Range["C4", missing], "orientationRange");
    this.orientationRange.Value2 = "This text is vertical.";
    this.orientationRange.Orientation = -90;
}


Community Additions

ADD
Show: