Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fso.CopyFolder

36 views
Skip to first unread message

bobh

unread,
May 2, 2013, 12:50:45 PM5/2/13
to
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.

Phil

unread,
May 2, 2013, 5:28:12 PM5/2/13
to
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
0 new messages