Document save question

G

Guest

Hi everybody,
Does anyone know if there's a way to save a Word Document as text and a word
document at the same time--that is, make 2 files with the same name at save
time but one with a .doc extension and one with a .txt extension? I have a
lot of .doc files I have to convert into text, and I need to keep the text
files updated with the .doc files. I've tried the batch conversion wizard and
it never finds all of the .doc files in the folder.

I have a feeling this might be impossible, but it would be nice to know if
it wasn't!

Thanks!
Jezzica85
 
G

Graham Mayor

The batch conversion wizard should work for all the files of the type you
select in the active folder - that's what it does!
What is the nature of the files it is missing? If you have not already done
so you should set Windows Explorer to display the extensions of known file
types and hidden files, so that you know exactly what you are dealing with.

If you want to do this on the fly, then you will need to create a macro to
save as text then save as a document.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Guest

I think there might be something wrong with my batch conversion wizard
because every time I try to run it it either can't find all the files ( even
though I told it to show extensions) or it makes Word freeze up. Is it
possible to record a macro that will save a file as text, then a document, or
do I have to write that from scratch? I don't have much experience with
macros.
 
G

Graham Mayor

I can't account for your batch conversion wizard - however, the following
macro will save the current document both as a document and as a text file
into the same folder:

Sub SaveOneasText()
Dim strFileA As String
Dim strDocName As String
Dim intPos As Integer

ActiveDocument.Save
strDocName = ActiveDocument.FullName
intPos = InStrRev(strDocName, ".")
strFileA = Left(strDocName, intPos - 1)
strFileA = strFileA & ".txt"
ActiveDocument.SaveAs FileName:=strFileA, _
FileFormat:=wdFormatDOSText
ActiveDocument.Close
Documents.Open FileName:=strDocName
End Sub

http://www.gmayor.com/installing_macro.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Guest

Thanks so much, that works great!
Jezzica85

Graham Mayor said:
I can't account for your batch conversion wizard - however, the following
macro will save the current document both as a document and as a text file
into the same folder:

Sub SaveOneasText()
Dim strFileA As String
Dim strDocName As String
Dim intPos As Integer

ActiveDocument.Save
strDocName = ActiveDocument.FullName
intPos = InStrRev(strDocName, ".")
strFileA = Left(strDocName, intPos - 1)
strFileA = strFileA & ".txt"
ActiveDocument.SaveAs FileName:=strFileA, _
FileFormat:=wdFormatDOSText
ActiveDocument.Close
Documents.Open FileName:=strDocName
End Sub

http://www.gmayor.com/installing_macro.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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