Hi Ric
This will do the needful
Sub ConvertRecursive()
Dim i As Long
Dim strSaveFile As String
With Application.FileSearch
.FileName = "*.doc"
.LookIn = "C:\My special folder"
.SearchSubFolders = True
.Execute
If .FoundFiles.Count > 0 Then
For i = 1 To .FoundFiles.Count
strSaveFile = .FoundFiles(i)
strSaveFile = Left$(strSaveFile, InStrRev(strSaveFile, ".")) &
"txt"
Documents.Open FileName:=.FoundFiles(i)
ActiveDocument.SaveAs FileName:=strSaveFile, _
FileFormat:=wdFormatText
ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
Next i
End If
End With
End Sub
Change the name of the folder in the Lookin property as appropriate. If you
want the user to be able to select the folder to be searched, then this
article describes how you can let the user browse to and select a folder
How to allow the user to browse to and select a folder
http://www.mvps.org/word/FAQs/MacrosVBA/BrowsDialog.htm
--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Ric said:
Anyone?
Harold Kless[MSFT} said:
Hi Ric,
This article provides a code sample that recursively move thru folders.
You'll need to add your code that opens each document and saves as a text
file.
185601 HOW TO: Recursively Search Directories by Using FileSystemObject
http://support.microsoft.com/?id=185601
Harold Kless, MCSD
Support Professional
Microsoft Technical Support for Business Applications
(e-mail address removed)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.