send text from word doc to .txt file

S

sarah

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
 
J

Jean-Guy Marcil

sarah was telling us:
sarah nous racontait que :
Is there a way to select all of the text on an open word document
through vba and send it to a .txt file?

Why VBA?
You can save as *.txt from the Save As dialog.
Also could this be done continuously so that the word document and
text file contain the same words?

What do you mean by "continuously "?
As you type? Whenever you save? Periodically?
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?

What do you mean by "extra white space"?
Double spaces between words? Empty paragraphs? Both? Something else?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
S

sarah

i want to perform a spell and grammar check in a minority language on the
text in ms word.the checker is in perl and is used at the command line - dos
prompt by typing the name of the perl module and the .txt file you wish to
check for errors.

i am sending the text from a word document by using the vba behind word to a
..txt file. I want to do this as the user types so that it is continuosly
checking spelling. I think i will need to use some kind of loop.

The grammar check will not work on a .doc file as there is a lot of
formatting - extra white spaces.
 
S

sarah

i want to perform a spell and grammar check in a minority language on the
text in ms word.the checker is in perl and is used at the command line - dos
prompt by typing the name of the perl module and the .txt file you wish to
check for errors.

i am sending the text from a word document by using the vba behind word to a
..txt file. I want to do this as the user types so that it is continuosly
checking spelling. I think i will need to use some kind of loop.

The grammar check will not work on a .doc file as there is a lot of
formatting - extra white spaces.
 
J

Jean-Guy Marcil

sarah was telling us:
sarah nous racontait que :
i want to perform a spell and grammar check in a minority language on
the text in ms word.the checker is in perl and is used at the command
line - dos prompt by typing the name of the perl module and the .txt
file you wish to check for errors.

i am sending the text from a word document by using the vba behind
word to a .txt file. I want to do this as the user types so that it
is continuosly checking spelling. I think i will need to use some
kind of loop.

The grammar check will not work on a .doc file as there is a lot of
formatting - extra white spaces.

I would strongly recommend that you do not attempt to do such a complicated
operation as the user types.
It would slow down Word so much as to make the user wish he had never heard
of you!

Something like this will be very complicated to set up. You need to save the
document, export the text to a txt file, run you perl script, report back
with all the errors in such a way that the user can accept/refuse them one
by one.... And what if the same word is used 15 times and the users does not
want the script to signal it as a mistake anymore? Or the opposite? Very
complicated code, unless the perl application handles all that.

I would recommend instead that the user only types the text, no formatting
(maybe in Notepad to make sure no formatting is used). Save as txt and run
the spell check. Finally, create the Word document and format as desired.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top