Share via


NamedRange.Orientation 屬性

取得或設定文字方向。

命名空間:  Microsoft.Office.Tools.Excel
組件:  Microsoft.Office.Tools.Excel (在 Microsoft.Office.Tools.Excel.dll 中)

語法

'宣告
Property Orientation As Object
Object Orientation { get; set; }

屬性值

型別:System.Object
整數值,範圍為 -90 到 90 度。

範例

下列程式碼範例會建立 NamedRange,然後使用 Orientation 屬性在 NamedRange 中顯示垂直文字。

這是示範文件層級自訂的範例。

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"], "orientationRange");
    this.orientationRange.Value2 = "This text is vertical.";
    this.orientationRange.Orientation = -90;
}

.NET Framework 安全性

請參閱

參考

NamedRange 介面

Microsoft.Office.Tools.Excel 命名空間