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

相关文章:

  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
  • 2021-08-25
  • 2021-09-28
  • 2022-12-23
  • 2021-12-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案