Every month, I have a folder full of around 70 word documents that all have to be modified in the same way. So, I wrote a macro that will modify each document. Now I would like to find a way to write a batch file or script that can process each word document in a particular folder. I want it to go through each document in the folder and run the macro.
It sounds simple enough but I don't know how to do it :(
Anyone have any ideas. Thanks to anyone who gives can help out. :)
2006-10-05
04:40:03
·
1 answers
·
asked by
Bang Boom
2
in
Computers & Internet
➔ Programming & Design
Ok well no one answered me but I figured it out. You can write another macro to do this. Here is what I have:
Sub Automation()
Dim sFile$
Const path = "C:\Documents and Settings\username\Desktop\ORDERS\" 'this is the path where the documents are stored.
sFile = Dir(path & "*.doc")
Do While sFile <> ""
Documents.Open (path & sFile)
'run the macro which modifies documents Application.Run "Project.NewMacros.MonthlyIOProcedure"
ActiveDocument.Close savechanges:=True
sFile = Dir
Loop
End Sub
2006-10-06
09:02:19 ·
update #1