Posted By

bblnrlz on 09/30/09


Tagged

merge document word combine


Versions (?)

How to Combine Multiple Word Documents into One Document


 / Published in: Visual Basic
 

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

  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

Report this snippet  

You need to login to post a comment.