把代码中Path下的文件复制到afterPath目录下
Sub copyFiles(Path As String, afterPath)
'Path:原文件夹路径;afterPath:目标文件夹路径
Dim Spath As String
'下边的我自己也不是很理解,但是效果达成是莫得问题的......
Set fs = CreateObject("Scripting.FileSystemObject")
Spath = Dir(Path, vbDirectory)
Do While Len(Spath)
If Spath <> "." And Spath <> ".." Then
fs.CopyFolder Path, afterPath
Spath = Dir()
End If
Loop
End Sub