Code:
Sub table()
With ActiveDocument
.Tables.Add Range:=Selection.Range, _
NumRows:=3, _
NumColumns:=3, _
DefaultTableBehavior:=wdWord8TableBehavior
' I want to select this table
' and add borders
End With
With ActiveDocument.Tables(2)
.Borders(wdBorderTop).LineStyle = wdLineStyleSingle
.Borders(wdBorderLeft).LineStyle = wdLineStyleSingle
.Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
.Borders(wdBorderRight).LineStyle = wdLineStyleSingle
.Borders(wdBorderHorizontal).LineStyle = wdLineStyleSingle
.Borders(wdBorderVertical).LineStyle = wdLineStyleSingle
.Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleSingle
.Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleSingle
End With
End Sub
Please see the comments above.
Please help, thx!