Thats something of a leap from recording a macro and the learning curve is
going to be quite steep. A good place to start would be
http://gregmaxey.mvps.org/VBA_Basics.htm. Then for the batch macro code you
would need the following which will open and close each document in a
selected folder. If you don't know how to use listings - see
http://www.gmayor.com/installing_macro.htm
Sub BatchProcess()
Dim strFilename As String
Dim strPath As String
Dim oDoc As Document
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)
With fDialog
.Title = "Select folder and click OK"
.AllowMultiSelect = False
.InitialView = msoFileDialogViewList
If .Show <> -1 Then
MsgBox "Cancelled By User", , _
"List Folder Contents"
Exit Sub
End If
strPath = fDialog.SelectedItems.Item(1)
If Right(strPath, 1) <> "\" _
Then strPath = strPath + "\"
End With
If Documents.Count > 0 Then
Documents.Close SaveChanges:=wdPromptToSaveChanges
End If
If Left(strPath, 1) = Chr(34) Then
strPath = Mid(strPath, 2, Len(strPath) - 2)
End If
strFilename = Dir$(strPath & "*.doc")
While Len(strFilename) <> 0
Set oDoc = Documents.Open(strPath & strFilename)
'
'Do what you want with oDoc
'
oDoc.Close SaveChanges:=wdSaveChanges
strFilename = Dir$()
Wend
End Sub
As to what to do with the documents (oDoc) when they are opened rather, this
depends on what *exactly* you want to change. When you have worked it out
for one document, post your further questions in the Word vba forum.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site
www.gmayor.com
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>