Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
.doc to .txt
Message
From
11/03/2010 04:21:42
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
11/03/2010 02:41:13
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01453860
Message ID:
01453868
Views:
104
This message has been marked as the solution to the initial question of the thread.
>I would like to convert .doc into plain text - i have opened the doc - how can i transfer the text to my m.txt file? Perhaps there is a more direct route than the one i have started.
>
>many thanks
>k
>
>
>objWord = CreateObject("Word.Application")
>objWord.Documents.Open ("C:\mydirectory\mydata.doc")
>objWord.visible = .F.
>
>??? move text to m.txt
>
>modify file m.txt
>
#DEFINE wdAlertsNone	0	
#DEFINE wdDoNotSaveChanges	0	
#DEFINE wdSaveChanges	-1	
#DEFINE wdPromptToSaveChanges	-2	
#DEFINE wdFormatText	2	
#DEFINE wdFormatTextLineBreaks	3	

lcDoc = "C:\mydirectory\mydata.doc"
lcSaveAs = "C:\mydirectory\mydata.txt"

oword = CREATEOBJECT('Word.Application')
oWord.Documents.Open(m.lcDoc)
oWord.DisplayAlerts = wdAlertsNone
oWord.Activedocument.Saveas(m.lcSaveas, wdFormatText)
oWord.Quit(wdSaveChanges)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform