Share via


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)

Syntax

'Declaration
Property Orientation As Object
    Get
    Set
Object Orientation { get; set; }

Property Value

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

Examples

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.

Private orientationRange As Microsoft.Office.Tools.Excel.NamedRange

Private Sub DisplayVerticalText()
    orientationRange = Me.Controls.AddNamedRange( _
        Me.Range("C4"), "orientationRange")
    Me.orientationRange.Value2 = "This text is vertical."
    Me.orientationRange.Orientation = -90
End Sub
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;
}

.NET Framework Security

See Also

Reference

NamedRange Interface

Microsoft.Office.Tools.Excel Namespace