VB Code:
'This example sets myRange equal to the contents of the active document, collapses myRange, and then inserts a 2x2 table at the end of the document.
Set myRange = ThisDoc.Content
myRange.Collapse Direction:=wdCollapseEnd
ThisDoc.Tables.Add Range:=myRange, NumRows:=2, NumColumns:=2
'This example creates a 5x5 table in the active document and then applies a predefined format to it.
Selection.Collapse Direction:=wdCollapseStart
Set myTable = ThisDoc.Tables.Add(Range:=Selection.Range, _
NumRows:=5, NumColumns:=5)
myTable.AutoFormat Format:=wdTableFormatClassic2
'This example inserts numbers and text into the first column of the first table in the active document.
num = 90
For Each acell In ThisDoc.Tables(1).Columns(1).Cells
acell.Range.Text = num & " Sales"
num = num + 1
Next acell