sending word text to a .txt file
Is there a way to select all of the text on an open word document through vba and send it to a .txt file?
Also could this be done continuously so that the word document and text file contain the same words?
What about formatting in word, is there a way of getting past this so that extra white space is not sent to the txt file?
Thanks
Re: sending word text to a .txt file
You mean like some kind of logger that writes the keypresses out to a textfile? Word already makes
backup copies of the document when it is being worked on, if the option is selected.
Re: sending word text to a .txt file
i need to run a perl module on the text. It works if run it on a .txt file however with all the formatting in word it goes crazy and cannot read it. Therefore i am sending all the text in the word document to a .txt file.
I would like to do it on keypress which i think would be done using a loop?
Also i am afraid that the formatting might still be sent to the .txt file and cause problems
Re: sending word text to a .txt file
Soundslike allot of issues may arrise if you do it on the keypress. You can do the
entire doc using the SaveAs method.
VB Code:
ActiveDocument.SaveAs FileName:="C:\DocumentText.txt", FileFormat:=wdFormatDOSText