DistanceFromRight Property

Applies To

Borders collection object.

Description

Returns or sets the space (in points) between the right edge of the text and the right border. Read/write Long.

Note Using this property with a page border, you can set either the space between the text and the right border or the space between the right edge of the page and the right border. Where the distance is measured from depends on the value of the DistanceFrom property.

See Also

DistanceFrom property, DistanceFromBottom property, DistanceFromLeft property, DistanceFromTop property.

Example

This example adds a border around each paragraph in the selection and sets the distance between the text and the right border to 3 points.

With Selection.Paragraphs.Borders
    .Enable = True
    .DistanceFromRight = 3
End With
This example adds a single border around each page in section one in the active document. The example also sets the distance between the right and left border and the corresponding edges of the page to 22 points.

With ActiveDocument.Sections(1)
    For Each aBord In .Borders
        aBord.LineStyle = wdLineStyleSingle
        aBord.LineWidth = wdLineWidth050pt
    Next aBord
    With .Borders
        .DistanceFrom = wdBorderDistanceFromPageEdge
        .DistanceFromLeft = 22
        .DistanceFromRight = 22
    End With
End With