NamedRange.Orientation 属性

获取或设置文本方向。

命名空间:  Microsoft.Office.Tools.Excel
程序集:  Microsoft.Office.Tools.Excel(在 Microsoft.Office.Tools.Excel.dll 中)

语法

声明
Property Orientation As Object
    Get
    Set
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", missing], "orientationRange");
    this.orientationRange.Value2 = "This text is vertical.";
    this.orientationRange.Orientation = -90;
}

.NET Framework 安全性

请参见

参考

NamedRange 接口

Microsoft.Office.Tools.Excel 命名空间