PageSetup 对象 (Excel)

代表页面设置说明。

注释

PageSetup 对象包含作为特性的所有页面设置属性(左边距、下边距、纸张大小等)。

示例

使用 Worksheet 对象的 PageSetup 属性返回 PageSetup 对象。

以下示例将打印方向设置为横向模式,然后打印工作表。

With Worksheets("Sheet1") 
 .PageSetup.Orientation = xlLandscape 
 .PrintOut 
End With

With 语句使同时设置多个属性变得轻松快速。 以下示例设置第一张工作表的所有边距。

With Worksheets(1).PageSetup 
 .LeftMargin = Application.InchesToPoints(0.5) 
 .RightMargin = Application.InchesToPoints(0.75) 
 .TopMargin = Application.InchesToPoints(1.5) 
 .BottomMargin = Application.InchesToPoints(1) 
 .HeaderMargin = Application.InchesToPoints(0.5) 
 .FooterMargin = Application.InchesToPoints(0.5) 
End With

属性

另请参阅

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。