本示例将显示活动文档的右边距设置。
PointsToInches 方法用来将结果转换为英寸。

With ActiveDocument.PageSetup
    Msgbox "The margin is " _
        & PointsToInches(.RightMargin) & " inches."
End With

 

本示例设置文档选定部分第二节的右边距。
InchesToPoints 方法用来将英寸转换为磅值。

Selection.Sections(2).PageSetup.RightMargin = InchesToPoints(1)