Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2005

Tip: Looking for answers? Try searching our database.

Automation to word, adding table and rows

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jesper Fj?lner - 03 Mar 2005 22:22 GMT
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.

Signature

Jesper Fj?lner
Denmark

PC Datasheet - 04 Mar 2005 17:15 GMT
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.

--
                                       PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
                             resource@pcdatasheet.com
                                www.pcdatasheet.com

> Normally I automate to word from Access and insert data in the word document
> at specified bookmarks.
[quoted text clipped - 13 lines]
> Jesper Fj?lner
> Denmark
Jesper Fj?lner - 04 Mar 2005 17:58 GMT
> 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.
PC Datasheet - 04 Mar 2005 18:32 GMT
Look at the CreateObject method in the Access Help file for late binding.

--
                                       PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
                             resource@pcdatasheet.com
                                www.pcdatasheet.com

> > Open Word, turn on the macro recorder then create a table and add some
> rows
[quoted text clipped - 8 lines]
> intellisense.
> Hopefully I'll be able to convert to late binding when it works.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.