John Baum
John Baum

Reputation: 3331

Finding a position in a word document to insert a table

I am working on writing some results of a database query into tables in Word. I have already done the code for accessing/creating objects from the results of my query and find myself a little stuck on writing these to a word template given to me. Its essentially a summary document in which i have to insert tables of the data i pulled from the db in the correct position in the document. So for instance, the document has say 4 section headers and under each header, there is some text after which i have to insert a table. One such header can be like:

School Records

Below you will find a table in which all school records will be listed:

So when i go to print my school record data object, i need a way to somehow insert my data in a table format right below the above line in the word document. Can anyone tell me how i can first find the correct position in the doc and then how you create a table in word from c#?

Upvotes: 1

Views: 4890

Answers (2)

superboy
superboy

Reputation: 97

Add bookmark to the word template and then search for the bookmark and replace it with the image/file.

Upvotes: 0

ControlPower
ControlPower

Reputation: 610

There is an article about how to insert images at specific position in Word document. Maybe it's useful for you to insert table either.

Upvotes: 1

Related Questions