Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I convert Wrod file to TXT file?
Message
 
À
07/04/2001 07:40:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00493172
Message ID:
00493176
Vues:
15
>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 '')
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform