Here is some code we use to copy a file twice.
Once for use by another process.
A second time for backup (with date stamp in the file name).
Sub CopyDailyReports()
'
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
'
'Gets the TEST.TXT report
Set f1 = fso.GetFile("\\NetworkPath\TEST.TXT")
'
' copy and paste the GetFile to a new folder
fso.CopyFile "\\NetworkPath\TEST.TXT", "\\NewNetworkPath\TEST.txt"
Wait 2
'
'copy and paste the GetFile to a new folder with date stamp for archive
purposes
fso.CopyFile "\\NetworkPath\TEST.TXT ", "\\NewNetworkPath\TEST" &
Format(f1.DateLastModified - 1, "_mmddyy") & ".txt"
Wait 2
'
'delete file or rem this line out to leave the original file in place
fso.DeleteFile "\\NetworkPath\TEST.TXT",True
Wait 2
'
Set f1 = Nothing
Set fso = Nothing
'
End Sub
Chase Rodgers
Financial Reporting Manager
Medical Center of Plano
*214-473-7490
[EMAIL PROTECTED]
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Walker, Reese
Sent: Wednesday, May 21, 2008 04:06 PM
To: [email protected]
Subject: [Talk] MOVEFILE
I cannot get the Move File to work in VB. Once the file has been
processed, I need it moved to the archive folder so there is no chance
of it being duplicated. This is what I am working wit so far...
FileSystemObject.MoveFile("H:\ePremis\Notes\test.txt",
"H:\ePremis\Notes\Archive\test.txt")
But I have tried different variations.
Object.MoveFile("H:\ePremis\Notes\test.txt",
"H:\ePremis\Notes\Archive\test.txt")
My.Computer.FileSystem.MoveFile("H:\ePremis\Notes\test.txt",
"H:\ePremis\Notes\Archive\test.txt") as according to MSDN
Any help would be greatly appreciated.
Thanks,
Reese
Reese E. Walker
Financial Systems Analyst
Phoebe Putney Memorial Hospital
Albany, GA. 31702
Phone: (229) 312-4259
Pager: (229) 431-7658
Fax: (229) 312-4316
________________________________
Disclaimer:
The HIPAA Final Privacy Rule requires covered entities to safeguard
certain Protected Health Information (PHI) related to a person's
healthcare. Information being faxed to you may include PHI after
appropriate authorization from the patient or under circumstances
that do not require patient authorization. You, the recipient, are
obligated to maintain PHI in a safe and secure manner. You may not
re-disclose without additional patient consent or as required by
law. Unauthorized re-disclosure or failure to safeguard PHI could
subject you to penalties described in federal (HIPAA) and state
law. If you the reader of this message are not the intended
recipient, or the employee or agent responsible to deliver it to
the intended recipient, please notify us immediately and destroy
the related message.