CopyFile Method problem

T

Tim

I am trying to write code within access which will
transfer a variable number of word documents into an
archive folder. After looking at the help file I am using
the following code, but it doesn't work. Ay ideas?

FileSystemObject.CopyFile "D:\Data\Database\Reviews\*.doc",
"D:\Data\Database\Reviews\Archive\"
 
K

Ken Snell [MVP]

I would use this code snippet instead:

Dim strFile As String
strFile = Dir("D:\Data\Database\Reviews\*.doc")
Do While strFile <> ""
FileCopy "D:\Data\Database\Reviews\" & strFile, _
"D:\Data\Database\Reviews\Archive\" & 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

Top