CooterBrown
IS-IT--Management
I'm trying to move a group of PDF's from one folder/staging area to another folder for processing. There are going to be about 1000 400KB pdf's. What is the most efficient way to do this?
Here is what I have tried but it is slow...
------------------------------------------------------------
If mFs.FolderExists(FolderSpec) Then
Set mFolder = mFs.GetFolder(FolderSpec)
On Error Resume Next
For Each mFile In mFolder.Files
space = InStr(1, mFile.DateCreated, " ")
TimePrinted = mFile.DateCreated
DatePrinted = Trim(Mid(mFile.DateCreated, 1, space))
CompareDate = Month(wrkQueryDate) & "/" & Day(wrkQueryDate) + 1 & "/" & Year(wrkQueryDate) & " 12:00:00 AM"
CompareHours = DateDiff("h", TimePrinted, CompareDate)
If (12 > CompareHours) And (CompareHours > -12) Then
MoveTo = (Environment & "\" & mFile.Name)
Debug.Print MoveTo
mFile.Copy MoveTo, True
mFile.Delete
Kill (mFile)
' - what is the diff between .delete and kill()?
i = i + 1
End If
Next
End If
Here is what I have tried but it is slow...
------------------------------------------------------------
If mFs.FolderExists(FolderSpec) Then
Set mFolder = mFs.GetFolder(FolderSpec)
On Error Resume Next
For Each mFile In mFolder.Files
space = InStr(1, mFile.DateCreated, " ")
TimePrinted = mFile.DateCreated
DatePrinted = Trim(Mid(mFile.DateCreated, 1, space))
CompareDate = Month(wrkQueryDate) & "/" & Day(wrkQueryDate) + 1 & "/" & Year(wrkQueryDate) & " 12:00:00 AM"
CompareHours = DateDiff("h", TimePrinted, CompareDate)
If (12 > CompareHours) And (CompareHours > -12) Then
MoveTo = (Environment & "\" & mFile.Name)
Debug.Print MoveTo
mFile.Copy MoveTo, True
mFile.Delete
Kill (mFile)
' - what is the diff between .delete and kill()?
i = i + 1
End If
Next
End If