孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

Function InsertIntoDoc(strPath as string)

  Set fso=CreateObject("Scripting.FileSystem")

  Set objFolder=fso.GetFolder(strPath)

  Set objFiles=objFolder.Files

  For each objFile In objFiles

    Debug.Print objFile.Name

    Set fout=fso.OpenTextFile(strPath & "\" & objFile.Name,1,False)

    tmpOut=fout.ReadAll

    str1=str1 & objfile.Name & chr(13)

    str1=str1 & tmpout & chr(13) & chr(13) & chr(13)

  Next

  Selection.TypeText Text:=str1

End Sub

 

CommandButton1_Click()

  Call InsertIntoDoc("E:\......\DataBase")

End Sub

posted on 2012-09-11 21:28  孤独的猫  阅读(408)  评论(0编辑  收藏  举报