Save text file

K

Ken

I want to be able to save a text file in the following manner:

copy c:\sales.txt c:\archive\sales_mmddyyyy_hhmmss.txt

Notice that I need to grab the system date and time and include it as part
of the file name. Any suggestions? Thanks.
 
V

visdev1

i would use the filesystemobject.
try somthing like this:

FileSystemObject.CopyFile "c:\sales.txt", "c:\archive\sales_" &
Format(Now(), "mmddyyyy_hhmmss")

Good Luck!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top