Thanks for your help in advance. I have multiple .txt files in a folder that I would like to move to a different folder if they meet certain criteria. If the txt file is less than 1000 kb then it’s moved to a different folder. Also if the txt file is greater than 36 hours old then this will go to the same archive folder. Here is the code I have so far:
Const SourceDir As String = "C:\test"
Const DestinationDir As String = "C:\test\Archive"
Dim strFileSize As String, strTempDate As String
Dim strCurrentFileName As String
'''''Less than 1000kb then move to archive folder
strCurrentFileName = (SourceDir & "*.txt")
Do
strFileSize = FileLen(strCurrentFileName)
If strFileSize < 1000 Then
FileCopy SourceDir & strCurrentFileName, DestinationDir & strCurrentFileName
Kill SourceDir & strCurrentFileName
End If
Loop Until strCurrentFileName = ""
Thanks!
Const SourceDir As String = "C:\test"
Const DestinationDir As String = "C:\test\Archive"
Dim strFileSize As String, strTempDate As String
Dim strCurrentFileName As String
'''''Less than 1000kb then move to archive folder
strCurrentFileName = (SourceDir & "*.txt")
Do
strFileSize = FileLen(strCurrentFileName)
If strFileSize < 1000 Then
FileCopy SourceDir & strCurrentFileName, DestinationDir & strCurrentFileName
Kill SourceDir & strCurrentFileName
End If
Loop Until strCurrentFileName = ""
Thanks!