Previous topicNext topic
Help > 开发指南 > Excel > API > 示例 > Worksheet >
如何:设置页面方向

此示例演示如何通过 Worksheet.ActiveView.Orientation 属性设置工作表页的方向。PageOrientation 枚举器列出可用的页面方向类型。

注意

打印工作表页面时使用WorksheetView.Orientation属性值。若要了解如何指定其他工作表打印选项,请参阅如何:指定打印设置文档。

Vb.Net

 ' 将页面方向设置为“横向”。

workbook.Worksheets(0).ActiveView.Orientation = PageOrientation.Landscape

C#

 // 将页面方向设置为“横向”。

workbook.Worksheets[0].ActiveView.Orientation = PageOrientation.Landscape;