代表页面设置说明。
说明
PageSetup 对象包含所有页面设置的属性(左边距、底部边距、纸张大小等)。
示例
使用 PageSetup 属性可返回一个 PageSetup
对象。下例将打印方向设置为横向,然后打印工作表。
示例代码 |
let wss = Worksheets.Item("Sheet1")
wss.PageSetup.Orientation = xlLandscape
wss.PrintOut()
|
With 语句使同时设置若干属性变得简单而迅速。下例设置第一张工作表的所有页边距。
示例代码 |
let psp = Worksheets.Item(1).PageSetup
psp.LeftMargin = Application.InchesToPoints(0.5)
psp.RightMargin = Application.InchesToPoints(0.75)
psp.TopMargin = Application.InchesToPoints(1.5)
psp.BottomMargin = Application.InchesToPoints(1)
psp.HeaderMargin = Application.InchesToPoints(0.5)
psp.FooterMargin = Application.InchesToPoints(0.5)
|