Accessing data from word documents
At present, in order to get data out of a word document i have to open it with word, as in Documents.Open. Having to do this with a number of documents is quite slow. Are there more efficient ways of accessing data from within a document?
I am quite impressed with the performance of ADO with MS Access databases. Not having to open Access to run queries makes life a breeze. I know it's not the same thing but reading data from 200+ documents takes a long time :(
Thanks! :D
Re: Accessing data from word documents
As of yet I have not come across anything like this yet. Een when you do a right click > print, it still opens Word briefly. The fileformat may be the only way to read it without instanciating an instance of Word so I would say to search for something using this logic. ;)
Re: Accessing data from word documents
Thanks a heap for your speedy reply,
I don't think i have 1/100000th the skills to reverse engineer the doc format :D, and that IS what you're referring to no? Or have i mis-interpreted?
Re: Accessing data from word documents
Sort of, if you open the file using standard File I/O then you may be able to identify where the data starts. ;)
Re: Accessing data from word documents
You can open the doc using the WOM and save it as a dos textfile. Then you can use the File I/O to open the textfile and read it. Although, this does use the WOM it may be just as slow but if the docs dont change and you need to get data again, you could read from the textfiles as a shortcut.
Re: Accessing data from word documents
Yeah the documents won't be modified, will this enable me to retain formatting though? I need to retain tables and dot points, otherwise i would store all the clauses as text files :)
Re: Accessing data from word documents
YAY! I just found a much quicker way of doing things.
Selection.InsertFile fileName:=clauseDoc
Thanks for your help! I learnt quite a bit :)