Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Thanks. This should do the trick!
"Doug Robbins - Word MVP" wrote: You could modify the macro in the article "Find & ReplaceAll on a batch of documents in the same folder at: http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm by deleting all of the stuff about finding and replacing so that it just opened each document and incorporating the following example from the Visual Basic Help file so that it saved each document as a text file Sub SaveAsTextFile() Dim strDocName As String Dim intPos As Integer 'Find position of extension in file name strDocName = ActiveDocument.Name intPos = InStrRev(strDocName, ".") If intPos = 0 Then 'If the document has not yet been saved 'Ask the user to provide a file name strDocName = InputBox("Please enter the name " & _ "of your document.") Else 'Strip off extension and add ".txt" extension strDocName = Left(strDocName, intPos - 1) strDocName = strDocName & ".txt" End If 'Save file with new extension ActiveDocument.SaveAs FileName:=strDocName, _ FileFormat:=wdFormatText End Sub -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "Jack Burman" wrote in message ... Would like to strip formatting from large group of small files and save as text files. Can a Word 2003 macro be created that will take a folder of small .docs and save all .docs as .txt files. If so, how can this be done? If not, is there some other method that can be used to automate this task. Ultimately, would like to concatenate all .txt files into one large file and use in another program - not word processing program. Thanks |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to count lines and save in differents files | Microsoft Word Help | |||
A Macro to Save Files | Microsoft Word Help | |||
I can't save word or excel files using save as | Microsoft Word Help | |||
Macro-ing mulitiple word files. | Microsoft Word Help | |||
Macro to Merge Word Files | Microsoft Word Help |