Article ID: 183711
Article Last Modified on 6/17/2005
Sub BorderCell()
'Check that selection is in table
If Selection.Information(wdWithInTable) Then
' Set the line Style
Options.DefaultBorderLineStyle = wdLineStyleSingle
' Set the line thickness
Options.DefaultBorderLineWidth = wdLineWidth050pt
' Set the line color
Options.DefaultBorderColorIndex = wdAuto
' Selects only the Cell the insertion point is in
Selection.GoTo what:=wdGoToBookmark, Name:="\cell"
' Applies border to cell
Selection.Cells.Borders.Enable = True
Selection.Collapse
Else
MsgBox "Not In A Table"
End If
End Sub
For more information about Defaultborderlinestyle, click the Office
Assistant while in the Visual Basic Editor, type defaultborderlinestyle,
click Search, and then click to view "DefaultBorderlineStyle Property."
179216 OFF98: How to Use the Microsoft Office Installer Program
163435 VBA: Programming Resources for Visual Basic for Applications
Additional query words: 8.0 office vba vbe vb
Keywords: kbhowto kbformat kbconversion kbconvert kbfaq KB183711