Word) (Border.LineWidth 属性

返回或设置对象边框的线条宽度。 读/写。

语法

expression. LineWidth

expression:必需。 表示“Border”对象的变量。

备注

如果该对象没有边框或具有多个行的宽度与边框,返回 写或 wdUndefined 。 如果指定的线宽的边框线型无效,则该属性将产生错误。 要确定对特定样式有效的线条宽度,请参阅“格式”菜单中的“边框和底纹”对话框。

示例

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

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

另请参阅

Border 对象

支持和反馈

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