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

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

语法Syntax

expressionexpression. LineWidth

expression:必需。expression Required. 代表边框对象的变量。A variable that represents a 'Border' object.

备注Remarks

返回一个WdLineWidth常量或wdUndefined ,如果对象没有边框或具有使用多个线宽的边框。Returns 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).

示例Example

本示例为活动文档的第一个表格的第一行添加下边框。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