WPS 基础接口 > 文字 API 参考 > PageSetup > PageSetup 对象

代表页面设置说明。PageSetup 对象包含文档的所有页面设置属性(如左边距、下边距和纸张大小)。

说明

使用 PageSetup 属性可返回 PageSetup 对象。以下示例将活动文档的第一节设为横向并打印该文档。

示例代码
ActiveDocument.Sections.Item(1).PageSetup.Orientation = wdOrientLandscape
ActiveDocument.PrintOut()

以下示例设置命名为“Sales.doc”的文档的所有页边距。

示例代码
let pages = Documents.Item("Sales.doc").PageSetup
pages.LeftMargin = InchesToPoints(0.75)
pages.RightMargin = InchesToPoints(0.75)
pages.TopMargin = InchesToPoints(1.5)
pages.BottomMargin = InchesToPoints(1)


请参阅