RightMargin Property

Microsoft Word Visual Basic

RightMargin Property

       

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.

expression.RightMargin

expression   Required. An expression that returns one of the objects in the Applies To list.

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.

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.

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