Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
.doc to .txt
Message
From
11/03/2010 14:50:32
 
 
To
11/03/2010 04:21:42
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01453860
Message ID:
01454012
Views:
50
amazing! it's fun just to watch this work - i lost track of why i needed it :)
thanks so much Cetin for taking the time to create this - very clever code.

k

>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform