On 02/05/2013 17:50:47, bobh wrote:
> Hi All,
>
> This is the correct Access2003 syntax for coping the ARWorkFiles
> folder and all the subfolders and files in those subfolder in ???
> This appears to be doing very weird things like coping the subfolders
> to the folder level. Do I need an \*.* in place of the \* or
> something like that.
>
> Dim fso
> Set fso = CreateObject("Scripting.FileSystemObject")
>
> fso.CopyFolder "C:\BH-Access\ARWorkFiles\*", "H:\BH-Access\"
>
> thanks
> bobh.
>
This works for me, copyinf folder, subfolder & files.
Note No error checking which I think is essential before overwriting etc
Function CopyFolder(FromFolder As String, ToFolder As String)
'?CopyFolder("E:\Phil Data\Fax*", "J:")
Dim FS As Object
Set FS = CreateObject("Scripting.FileSystemObject")
FS.CopyFolder FromFolder, ToFolder
End Function
Phil