全部显示

LineWidth 属性

       

返回或设置对象边框的线宽。如果对象中没有边框,则返回 WdLineWidth 常量;如果对象中包括一种以上的线宽,则返回 wdUndefined 常量。可读写。

expression.LineWidth

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

说明

如果指定的线宽对边框线型无效,则此属性将产生一个错误。若要确定对特定线型有效的线宽,请参阅“格式”菜单中的“边框和底纹”对话框。

示例

本示例为活动文档的第一个表格的第一行添加底边边框。

If ActiveDocument.Tables.Count >= 1 Then
    With ActiveDocument.Tables(1).Rows(1).Borders(wdBorderBottom)
        .LineStyle = wdLineStyleSingle
        .LineWidth = wdLineWidth050pt
    End With
End If

本示例为所选内容的左边添加红色波浪线边框。

With Selection.Borders(wdBorderLeft)
    .LineStyle = wdLineStyleSingleWavy
    .LineWidth = wdLineWidth075pt
    .ColorIndex = wdRed
End With