Dim objFSO
Dim sSourceFolder
Dim sDestFolder
Dim sDBFile
Dim sDateTimeStamp
Set objFSO = CreateObject("Scripting.FileSystemObject")
sSourceFolder = "C:\Oceanside\"
sBackupFolder = "C:\Files_Found\"
sDBFile = array _
("ROWP19-0499","ROWP19-0543","ROWP19-0544","ROWP19-0545","ROWP19-0550","ROWP19-0559","ROWP19-0562","ROWP19-0567","ROWP19-0645")
sDBFileExt = "pdf"
'If the backup folder doesn't exist, create it.
If Not objFSO.FolderExists(sBackupFolder) Then
objFSO.CreateFolder(sBackupFolder)
End If
'Copy the file as long as the file can be found
For i = 0 to Ubound(sDBFile)
If objFSO.FileExists(sSourceFolder & "\" & sDBFile(i) & "." & sDBFileExt) Then
objFSO.CopyFile sSourceFolder & "\" & sDBFile(i) & "." & sDBFileExt,_
sBackupFolder & "\" & sDBFile(i) & "." & sDBFileExt
MsgBox sSourceFolder & "\" & sDBFile(i) & "." & sDBFileExt & " was copied to " & sBackupFolder
End if
Next
Set objFSO = Nothing
Thanks in advance!
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Expert of the Year award recognizes an expert who helped improve Experts Exchange in the past year through high levels of contributions and participation on site. This award is given to the expert who has achieved the highest levels of participation, while maintaining quality contributions and professionalism.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.