Extract Data to Word Template File

gstylianou

Registered User.
Local time
Today, 08:48
Joined
Dec 16, 2013
Messages
359
Dear Friends,

I have created a database for managing medical incidents, through which I would like to extract the data from the form to the database in a standard Word (Template) file. I have done this in part because, although I was able to export the data to Word with the help of the forum, but I don't know how these data could go and "sit down" everywhere in the right place, into Word Template. I mean the name in the appropriate box, the surname in place, etc.,

For your convenience, I attach a compressed folder in which you will find both the database and what I have done so far,as well as the Word file template. However, for the extraction of data in order to work, unpack the folder, then create a new folder called "Test" in C: /, and another folder one into the existing named "Docs", and then another third one into the second one with name "CustDocuments.

I hope someone can help and thanks in advance
 

Attachments

I did this once by cheating a bit.

I made the Word document have a TABLE that had the topic name in column 1 and the part to be filled in under column 2.

Then when you open a Word App Object, you can find the table because there is a collection of tables: WApp.Tables - which you can use to find the table. If there is only one table in the document, it is the first table in the app. It might, however, be Wapp.Tables(0) because the Component Object Model uses zero-based numbering.

If you then want to diddle, the table is a list of either rows or columns. If you pick row 0, then column 2 of that row is row(0).Cell(1) - remember, COM numbers from 0, not 1.

When I last did this, all I needed to do was to open word, find the table, and start plucking data from the second cell of each row, one row at a time.
 
Hi my friend Doc man,

Could you please send me a sample for the solution which you suggest? Otherwise, could you please modify my solution because i'm not so familiar with vba?

Regards
 

Users who are viewing this thread

Back
Top Bottom