How to Combine Multiple Word Documents into One Document


/ Published in: Visual Basic
Save to your folder(s)



Copy this code and paste it in your HTML
  1. Sub MergeDocs()
  2. Dim rng As Range
  3. Dim MainDoc As Document
  4. Dim strFile As String
  5. Const strFolder = "C:\Book\Chapters\" 'change to suit
  6. Set MainDoc = Documents.Add
  7. strFile = Dir$(strFolder & "*.doc") ' can change to .docx
  8. Do Until strFile = ""
  9. Set rng = MainDoc.Range
  10. rng.Collapse wdCollapseEnd
  11. rng.InsertFile strFolder & strFile
  12. strFile = Dir$()
  13. Loop
  14. End Sub

URL: http://www.gaebler.com/How-to-Combine-Multiple-Word-Documents-into-One-Document.htm

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.