LineWidth 属性 (Word)Border.LineWidth property (Word)

返回或设置对象边框的线条宽度。Returns or sets the line width of an object's border. 读/写。Read/write.


expression.expression. LineWidth

_表达式_是必需的。expression Required. 表示“Border”对象的变量。A variable that represents a 'Border' object.


如果对象没有边框或具有多个线宽的边框, 则返回一个读写常量或wdUndefinedReturns a WdLineWidth constant or wdUndefined if the object either has no borders or has borders with more than one line width. 如果指定的线条宽度对边框样式无效,则该属性将产生错误。If the specified line width isn't available for the border's line style, this property generates an error. 要确定对特定样式有效的线条宽度,请参阅 “格式” 菜单中的 “边框和底纹” 对话框。To determine the line widths available for a particular line style, see the Borders and Shading dialog box (Format menu).


本示例为活动文档的第一个表格的第一行添加下边框。This example adds a border below the first row in the first table of the active document.

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

本示例为选定内容的左边添加红色波浪线边框。This example adds a wavy, red line to the left of the selection.

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

另请参阅See also

Border 对象Border Object

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.