SpartanValor
asked on
Loop Through Folder AND Sub-Folders and Print All Files
How to a create a Macro that will search through a folder, and all subfolders, and print all files? The files I am opening are linked and must be updated when opened/printed. I don't want to have to click "Yes" to the update each time (to a few hundred files). I tried a few programs from google search but they don't search subfolders and they didn't resolve the requirement to update the file. Thank you.
ASKER
Unknown sub folder names. That'd be great if you could.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you Graham. I don't know what this means,
"You will need to set up the QueryRefresh registry entry in the link hitsdoshi1. Then you should be able to run this VBA code without interruption."
Can you please explain? Thanks.
"You will need to set up the QueryRefresh registry entry in the link hitsdoshi1. Then you should be able to run this VBA code without interruption."
Can you please explain? Thanks.
ASKER
Ok, that was stupid. Nevermind. I just woke up, a little groggy. Ok, this looks great. One problem, its going to be next to impossible to access/change regedit at work due to the security settings. I will file a request with IT and hopefully it can be done. I will try this on Monday. Thank you very much Graham!
Sorry, there was a typo that left the sentence a bit garbled.
ASKER
Hmmm, weird. I was able to add the DWORD. I'm going to try it. Anyway to adjust the above so that it only prints from page 1 to page 1?
ASKER
Ok, so after adding to regedit I restarted my pc and then ran the Sub(). Unfortunately, its still asking me to "update" or "don't update". Any suggestions?
ASKER
Sorry for the real time posts. I finally got the update prompt to go away by selecting Tools -> Options -> Edit -> (Uncheck) Ask to Update Automatic Links. But now after it prints the file it ask me if I want to save it before closing it. How can I elect "Yes" automatically? Thanks.
ASKER
Ok so that was stupid. I added "xlWbk.Save" after "xlWbk.PrintOut". So I think that settles it. This is now resolved. Thank you very much Graham.
http://support.microsoft.com/kb/248204
So there are known sub-directory in folders ? or you have to get the name of sub-folder as well ?
I think we can come up with some kind of macro to pick up file and print it
Please provide more details.....if possible attach sample...