Dim spath As String = "\\KMCTZD\kmctzd$\档案存储\" Dim dpath As String = "C:\Users\WC\Desktop\接收下载\" Dim errfiles As String Dim scsFiles As String For Each r As Row In Tables("档案管理_Table3").GetCheckedRows If r.Isnull("归档文件") = False Then If FileSys.FileExists(spath & r("归档文件")) Then FileSys.CopyFile(spath & r("归档文件"),dpath & r("归档文件"),True) If FileSys.FileExists(dpath & r("归档文件")) = True Then scsFiles = scsFiles & r("归档文件") & vbcrlf Else errfiles = errfiles & r("归档文件") & vbcrlf End If Else errfiles = errfiles & r("归档文件") & vbcrlf End If End If Next If scsFiles > "" Then Messagebox.show("以下文件下载成功!" & vbcrlf & scsFiles ,"提示",MessageBoxButtons.OK,MessageBoxIcon.Information) End If If errfiles > "" Then Messagebox.show("以下下载失败!" & vbcrlf & errfiles ,"提示",MessageBoxButtons.OK,MessageBoxIcon.Information) End If
|