Reading a table in a word document

pachjo

Well-known member
Joined
Dec 12, 2006
Messages
370
Programming Experience
10+
Can anyone point me to a good source of help to show how I can access/import a word table into a sql server express database?

I can create the word application and open the required document but I cannot see how I can access the table or its individual cells?

Thanks
 
I would open the word document

then copy/paste into excel.

Then from that you can use the openrowset method to query the excel fie.

Other then that I do not know of any way to parse a table in microsoft word.
 
The Word automation document has a Tables collection, have you started looking into this?
 
The Word automation document has a Tables collection, have you started looking into this?

Hi yes I found this last night and have started down that route, however I cannot as yet get the word document assigned to the objWord.Document object?
 
Have found out now that I have to open the document using the Word.Documents.Open(filename) method and then assign this to the document object thus, objWordDocument = objWord.Documents(1).

I then identified and assigne the table in the docuemnt and start to cycle thru the rows and cells but have not figured out yet how to get the actual value out of the cell as there does not apper to be a .Text value for it!
 
try cell.Range.Text
 
Back
Top