Hi everyone,
I have limited knowledge in VBA programming, but used to learn PHP and Java in past, so might understand a logic of simple scripts.
I have hundreds of emails coming with(e.g.) Subject "Payslip" and From "Payroll". All those emails contain PDF file "Payslip.pdf" and information in each file is unique.
There is a rule in Outlook to move all those emails to folder "Payslips AutoPrint"
I found online macro for batch printing and adjusted it for my needs:
Now to the problem - because my pdf files all have the same name ("Payslip.pdf") this script doesn't work for my situation.Please Login or Register to view this content.
It would be nice to have those files saved to "C:\TempPayslips\" in following format "001-Payslip.pdf .... XXX-Payslip.pdf" with 001 being incremented each time by 1 and in an ideal world script needs to make sure that it doesn't assign any of the existing names to the file (e.g. 025-Payslip.pdf is already exist and next saved would be 026-Payslip.pdf)
Now let's say that it printed successfully all 300 payslips and moved all emails to "PrintedPayslips", if there is a way to empty this folder(PrintedPayslips) and delete all content of C:\TempPaySlips\ when macro is done with printing them all?
Any help very appreciated.
Bookmarks