>Hi, everyone!
>
>I have about 1000 Word reports and I want to extract information from these reports into a VFP table. In order to do that, I think I must first convert Word files to a text file, and then, I can extract data using low level file functions.
>
>I tried this:
>
>ox=createobject('word.application')
>ox.application.visible=.t.
>ox.application.documents.open('mydoc.doc')
>ox.application.ActiveDocument.saveas('mydoc.txt','wdFormatTextLineBreaks')
>ox.application.ActiveDocument.close
>
>But a type mismatch error occurs in "saveas" command. Please help me out.
>
>cycho@nuri.net
wdFormatTextLineBreaks is a constant.
you must give the value of that constant to Word and not the name.
If you have a word constants file you may write
ox.application.ActiveDocument.saveas('mydoc.txt',wdFormatTextLineBreaks)
(without the '')