I have this as part of my script:
I either need the time added or something other than "True" because if there are two files on the same day, I don't WANT it overwritten but I copied this from the only example that was available and I don't know how to make it do what I need.
thanks
Code:
[green]'Set the Path & Filename of the Source file and the Destination 'file. [/green]
sSourceFile = "C:\TestData\Voucher.csv"
sOldFile = "C:\TestData\A"
sDestinationFile = "C:\TestData\bak\Voucher" & _
Year(Date) & _
Right("0" & Month(Date), 2) & _
Right("0" & Day(Date), 2) & _
".txt"
[green]'Create a File System Object[/green]
Dim pFSO
Set pFSO = CreateObject("Scripting.FileSystemObject")
[green]'Copy and rename the file
'The "True" parameter indicates that if the file already exists in the destination, then it will be overwritten
[/green]
Call pFSO.CopyFile(sSourceFile, sDestinationFile, True)
Call pFSO.DeleteFile(sOldFile, True)
I either need the time added or something other than "True" because if there are two files on the same day, I don't WANT it overwritten but I copied this from the only example that was available and I don't know how to make it do what I need.
thanks