Border.LineWidth property (Word)
Returns or sets the line width of an object's border. Read/write.
expression Required. A variable that represents a 'Border' object.
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).
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
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.