Share via


PageSetup.RightMargin Property

Word Developer Reference

Returns or sets the distance (in points) between the right edge of the page and the right boundary of the body text. Read/write Single.

Syntax

expression.RightMargin

expression   A variable that represents a PageSetup object.

Remarks

If the MirrorMargins property is set to True, the RightMargin property controls the setting for outside margins and the LeftMargin property controls the setting for inside margins.

Example

This example displays the right margin setting for the active document. The PointsToInches method is used to convert the result to inches.

Visual Basic for Applications
  With ActiveDocument.PageSetup
    Msgbox "The right margin is set to " _
        & PointsToInches(.RightMargin) & " inches."
End With

This example sets the right margin for section two in the selection. The InchesToPoints method is used to convert inches to points.

Visual Basic for Applications
  Selection.Sections(2).PageSetup.RightMargin = InchesToPoints(1)

See Also