全部显示

LineStyle 属性

       

返回或设置指定对象的边框线型。WdLineStyle,可读写。

expression.LineStyle

expression   必需。该表达式返回一个 Border 对象。

说明

如果是为单个字符或单词区域设置 LineStyle 属性,应选用字符边框。

如果是为一个或几个段落区域设置 LineStyle 属性,应选用段落边框。连续段落之间的边框可应用 InsideLineStyle 属性。

如果是为节设置 LineStyle 属性,应选用节中的页面边框。

示例

如果所选内容是一个段落,或折叠起来的选定内容,本示例将在当前段落之前添加 0.75 磅宽的单线段落边框。如果所选内容中不包括段落,则为所选文字添加边框。

With Selection.Borders(wdBorderTop)
    .LineStyle = wdLineStyleSingle
    .LineWidth = wdLineWidth075pt
End With

本示例为活动文档中的每个框架下添加 1.5 磅宽的双线边框。

For Each aFrame In ActiveDocument.Frames
    With aFrame.Borders(wdBorderBottom)
        .LineStyle = wdLineStyleDouble
        .LineWidth = wdLineWidth150pt
    End With
Next aFrame

本示例在活动文档的第四个单词周围设置边框,在设置边框的文本周围应用单线边框(在本例中为顶端边框)。

ActiveDocument.Words(4).Borders(wdBorderTop) _
    .LineStyle = wdLineStyleSingle