当前目录下有1.htm 2.htm .............63.htm
有好的方法能复制到另外一个文件夹否!
下面是偶的代码,不过有不少问题
Private Sub Command1_Click()
dim i as integerFor i = 1 To 63
FileCopy App.Path + "\" + i + ".htm", "e:\" + i + ".htm"
Next
End Sub出现类型不正确的错误!不知道有其他的好的代码否!

解决方案 »

  1.   

    FileCopy App.Path + "\" + i + ".htm", "e:\" + i + ".htm"
    ---------------------------------
    App.Path 后面多了个\FileCopy App.Path + i + ".htm", "e:\" + i + ".htm"
      

  2.   

    把当前目录拷贝到E盘:
    CreateObject("Scripting.FileSystemObject").CopyFolder App.Path, "e:\"
      

  3.   

    FileCopy App.Path + "\" & i & ".htm", "e:\" & i & ".htm"
      

  4.   

    还得一个个拷,不过你可以做一个有规律的Function,
    专门来处理批量文件拷贝。FileCopy App.Path + "\" & i & ".htm", "e:\" & i & ".htm"Private Function CopyBatchFiles(StartNum As Integer,EndNum As Integer,SpecName As String,strRule As String)As BooleanEnd Function
      

  5.   

    1:首先我要说的是,我当前目录下还有其他的文件,不仅仅是1.htm,2.htm。所以我其实要做的是把这样有规律的文件清理出来放到另外一个文件夹中2:问题可能就出在循环中了,估计是上一个文件还没有处理完毕下一个就跟着来了,所以出错!
      

  6.   

    Private Sub Command1_Click()
    Do While i <= 10
    FileCopy App.Path + "\" + i + ".htm", "e:\" + i + ".htm"
    Kill App.Path + "\" + i + ".htm"
    If Dir(App.Path + "\" + i + ".htm") = 0 Then
    Print i
    i = i + 1
    End If
    Loop
    End Sub换了个思路,结果错误还是一样的大家看看有没有好的思路
      

  7.   

    楼主同志,前面已经给你改了错误的句子!!!!!比比下面两个句有什么区别,你也没看人家的回贴呀.FileCopy App.Path + "\" & i & ".htm", "e:\" & i & ".htm"
    FileCopy App.Path + "\" + i + ".htm", "e:\" + i + ".htm"