Dim myFile As String
Dim PathToUse As String
Dim myDoc As Document
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)
With fDialog
.Title = "Select Folder containing the documents to be modifed and click
OK"
.AllowMultiSelect = False
.InitialView = msoFileDialogViewList
If .Show <> -1 Then
MsgBox "Cancelled By User"
Exit Sub
End If
PathToUse = fDialog.SelectedItems.Item(1)
If Right(PathToUse, 1) <> "\" Then PathToUse = PathToUse + "\"
End With
If Documents.Count > 0 Then
Documents.Close SaveChanges:=wdPromptToSaveChanges
End If
myFile = Dir$(PathToUse & "*.do?")
While myFile <> ""
Set myDoc = Documents.Open(PathToUse & myFile)
'*******************************************
'do your stuff
'*******************************************
myDoc.Close SaveChanges:=wdSaveChanges
myFile = Dir$()
Wend
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Mark Reid wrote:
> Hi
>
> I need to open a set of files 1 ant a time process the file by
> running a macro (already Written) then move on to the next file in
> the list can anyone help i am using word 2003 and 2007
>
> Thanks in advance
>
> Mark Reid