Automation to word, adding table and rows

  • Thread starter Thread starter Jesper Fjølner
  • Start date Start date
J

Jesper Fjølner

Normally I automate to word from Access and insert data in the word document
at specified bookmarks.
Now I need to open a document and create a table and add some rows to it. I
need to use late binding.

I using something like:
Set oWord = CreateObject("word.application") 'late binding
oWord.Documents.Add "c:\template.dot"
oWord.Visible = True

But how do I add a table and add some rows and values in them?
I'll be looping a recordset and inserting values in x number of rows.
Thanks for any help.
 
Open Word, turn on the macro recorder then create a table and add some rows
to it. Turn the macro recorder off. Go to edit macro and your code will be
there. Copy and paste it into Access. This is a good start but you will need
to do some tweaking to make it work in Access.
 
Open Word, turn on the macro recorder then create a table and add some
rows
to it. Turn the macro recorder off. Go to edit macro and your code will be
there. Copy and paste it into Access. This is a good start but you will need
to do some tweaking to make it work in Access.

Thanks, I'm trying that right now. The word object model isn't that easy to
figure out.
I'm doing it with early binding while I'm programming in order to have
intellisense.
Hopefully I'll be able to convert to late binding when it works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top