Hello,




I am generating report based on access data into word doc, I would like to insert table after few paragraphs I am having code as below.


First I am creating paragraph with some text and then I would like to have table with some content ( access data or may be hard coded ).


it is not working and gives error as below some time after modification of code it works but inserts the table at top of the document. also please let me know how to insert starting from page 2 of word document using vba.


Object doesn't support this property or method


wdapp.Visible = True
Set wddoc = wdapp.Documents.Add
Set oPara1 = wddoc.Content.Paragraphs.Add
With oPara1.Range
.InsertParagraphAfter
.Text = "test" & vbCr
.Paragraphformat.Alignment = 1
With .Font
.Name = "Verdana"
.Size = "9"
' .Bold = True
End With
End With




MsgBox "in1"
' Dim objRange, objTable As Object
Set objRange = wddoc.Range(wddoc.Paragraphs(3).Start, wddoc.Paragraphs(3).End - 1)
MsgBox "in"
wddoc.Tables.Add objRange, 9, 2
MsgBox "out"
Set objTable = wddoc.Tables(1)
objTable.Borders.Enable = False
objTable.Cell(1, 1) = "test1"
objTable.Cell(2, 1) = "test2"
objTable.Cell(2, 2) = "test3"