I use this code to copy all MS Word files from C:\Bam\Renewals to E:\Transfers\Updates. It works perfect.
Dim lb As Variant
Set lb = CreateObject("Scripting.FileSystemObject")
lb.CopyFile "C:\Bam\Renewals\*.doc", "E:\Transfers\Updates\"
What I want to do now is restrict it to copy only Word files modified/created the previous day. I tried incorporating the FileDateTime function but I don’t seem to have luck with it. Can anyone help with my problem?
Dim lb As Variant
Set lb = CreateObject("Scripting.FileSystemObject")
lb.CopyFile "C:\Bam\Renewals\*.doc", "E:\Transfers\Updates\"
What I want to do now is restrict it to copy only Word files modified/created the previous day. I tried incorporating the FileDateTime function but I don’t seem to have luck with it. Can anyone help with my problem?