Help on file copy please

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Using Access 2002 I want to programatically copy all jpg
files, whose name starts with the same 4 digit code, from
a temp folder into a subfolder whose name is the same as
that 4 digit.

I would appreciate some guidance on how to do this

Thanks in advance
 
This should get you started:

Dim strFile As String
Const str4DigitCode As String = "4444"
strFile = Dir("C:\MyFolder\" & str4DigitCode & _
"*.jpg")
Do While strFile <> ""
FileCopy "C:\MyFolder\" & strFile, _
"C:\MyNewFolder\" & Left(strFile, 4) _
& "\" & strFile
strFile = Dir()
Loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top