Question
April 3, 2007 at 08:00 AM
jocallahan

Access – Word Automation problem

by jocallahan . Updated 19 years, 6 months ago

In writing data from Access 2003 to a Word 2003 table using Automation, the Word table doesn’t continue from page to page as it does automatically when manually inserting new rows. It merely grows to the size of one page, including header and footer and then stops taking data. Here’s the code I’m using to add rows to the table as I write data to it.

Set WordObj = CreateObject(“Word.Application”)
Set WordDoc = WordObj.Documents.Open(“C:\TestDoc.dot”)
.
.
lRow = lRow + 1
.
.
If WordDoc.Tables(1).Rows.Count < lRow Then WordDoc.Tables(1).Rows.Add End If Thanks for your help.

This discussion is locked

All Comments