5 pts.
 File referencing in vba
Hi All. I have a user form in Word that populates a doc, saves as a temp file, emails as attachment and then kills the temp file. I am worried that with momre than one user at any one time one person's code might kill another person's temp file before they have sent it. Any ideas as to how I might create a unique filename each time or other suggestions would be most helpful.

Software/Hardware used:
ASKED: February 12, 2009  3:58 PM
UPDATED: February 12, 2009  4:17 PM

Answer Wiki:
Without more information on how your creating the temp file I wouldn't be able to be sure this answer helps you. But try adding the Date and time to the filename for the temp file like so, assuming your filename variable is "filename": filename = Year(Now) & "-" & Month(Now) & "-" & Day(Now) & "-" & Hour(Now) & "-" & Minute(Now) & "-" & Second(Now) & "-" & Rnd(100) & "-" & filename It's quick and dirty, but should work.
Last Wiki Answer Submitted:  February 12, 2009  4:17 pm  by  Jerry Lees   5,320 pts.
All Answer Wiki Contributors:  Jerry Lees   5,320 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _