5

I have about ~50 .doc files, that look perfect (they are extracted with Able2Extract). Now I want to join these 50 files into one huge .doc. I've tried using Word's in-built "Insert" feature, but that messed up the whole format. I want to keep everything I have. Like just document1 -> document2 -> document3.

Nothing "intelligent" or "smart" needed during the conversion, just the capability of joining them. (Thus making them all searchable, that's the ultimate aim.) I don't mind if the method/solution applies a single blank page at every document end either.

Sathyajith Bhat
  • 61,504
  • 38
  • 179
  • 264
Apache
  • 15,981
  • 25
  • 100
  • 152
  • Duplicate of http://superuser.com/questions/423732/merge-70-000-rtf-doc-files-into-one?rq=1 ? – Brad Patton Jun 21 '12 at 20:08
  • Word's insertfile command will mess up the documents. I don't mind even if the method applies one extra spare page between every document. I just want to keep the original format of the documents (else everything gets distorted), and be able to search in the big file. – Apache Jun 21 '12 at 20:09
  • Would this work? http://answers.yahoo.com/question/index?qid=20100223061257AAlhcfw – Saaru Lindestøkke Jun 21 '12 at 20:16
  • @BartArondson - The script that Brad linked (thanks Brad!) uses the same approach. It magically works for some of the files, and some gets like... _really_ deformed. And I can't fix that. I mean, it's not just a line but it's totally deformed. – Apache Jun 21 '12 at 20:18
  • Back to the script (I wanted to try everything): The official help shows: Italic ~ CTRL+I or CTRL+SHIFT+I. And that's what happens, 51 times an Italic and back. :-/ – Apache Jun 21 '12 at 21:03

2 Answers2

2

Do the documents have to be in a .doc after you're done building them? You might try combining them into a large .pdf with Adobe Acrobat or something similar. That would achieve your goal of having all the documents together in a searchable format, while preserving the formatting/layout of each one individually.

Darth Android
  • 37,872
  • 5
  • 94
  • 112
  • The final aim is to have a searchable epub document. Or anything similar. PDF? Hmm... I don't know if Able2Extract could RE-Extract the stuff from PDF again, but it may worth a try, thanks for the tip! – Apache Jun 21 '12 at 20:18
0

The best way to join the documents while retaining original formatting is to use VBA and automate the steps you would do to join the documents manually. You will need to keep a few things in mind to make sure the formatting stays the same:

  • Ensure each document is separated by a new section
  • Ensure each document is imported using Keep source formatting.

The following VBA macro should help automate the process while keeping the above in mind. I havn't tested it first so I apologise if there are any bugs.

Sub CombineAll(sPath As String) 
    Dim baseDoc As Document, sFile As String 
    Set baseDoc = Application.Documents.Open(sPath & "BaseDoc.doc") 

    sFile = Dir(sPath & "*.doc") 
     'Loop through all .doc files in that path
    Do While sFile <> "" 

       Set sourceDoc = Application.Documents.Open(sPath & sFile) 
       Application.Selection.WholeStory
       Application.Selection.Copy
       Application.ActiveWindow.Close savechanges:=wdDoNotSaveChanges
       baseDoc.Activate

       Application.Selection.PasteAndFormat (wdFormatOriginalFormattig)
       baseDoc.InsertBreak Type:=wdSectionBreakNextPage
       sFile = Dir 
    Loop 
End Sub 
Adam
  • 7,361
  • 2
  • 26
  • 41