Word) (Borders.DistanceFromRight 属性

返回或设置文本的右边缘与右边框之间的间距 (以磅为单位)。 读/写 Long

语法

expressionDistanceFromRight

表达 一个代表“Borders”对象的变量。

备注

对页面边框使用本属性,可设置文本与右边框之间的空间或页面的右边缘与右边框之间的间距。 距离距离取决于 DistanceFrom 属性的值。

示例

本示例为所选内容的每个段落添加边框,并将文本与右边框的距离设置为 3 磅。

With Selection.Paragraphs.Borders 
 .Enable = True 
 .DistanceFromRight = 3 
End With

本示例为活动文档中第一节的每页添加单线型页面边框。 然后将左右边框与相应的页面边缘的距离设置为 22 磅。

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

另请参阅

边框集合对象

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。