Hi Experts,
I have a long VBA macro I'd like to run on lots of Word documents all of which will be in one folder. I want to set it up to run while I'm at work and when I return it will (hopefully) be finished.
At the moment my macro works when I'm in the document (ie I open the document, run the macro, save the revised document and then close it, open the next one, etc.).
How can I make a second macro that handles all the opening, and closing bit, cycling through each in a folder? It's hard to explain, but the syntax would be the equivalent instruction to something like:
for each file in directory X
if it is a word document then
open next file
call long macro
save that file
close that file
end if
next file
How on earth do I make it do that kind of cycle? Thanks in advance for any ideas you have.
Cheers,
PatternNut
Start Free Trial