Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I convert Wrod file to TXT file?
Message
 
To
07/04/2001 07:40:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00493172
Message ID:
00493176
Views:
16
>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 '')
Previous
Reply
Map
View

Click here to load this message in the networking platform