I have to run a 4+ minute report for each of 30 depts (ie - a 2 hour report) which outputs each department to a pdf file. For others in my company I've written an ADO loop which uses sendkeys to populate the filename in the print box. However, sendkeys sends to the active window, and unless I don't use my computer for 2 hours, another window will definitely be active.

I've tried a gimpy runaround like resetting the caption of the report to the department - which does actually change the filename, but sendkeys is still required for {ENTER} to close the print box.

Does anyone know of a good replacement for sendkeys?

Thanks!