Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
Duplicate of superuser.com/questions/423732/… ? –  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. –  Shiki Jun 21 '12 at 20:09
    
    
@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. –  Shiki 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. :-/ –  Shiki Jun 21 '12 at 21:03
add comment

2 Answers

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.

share|improve this answer
    
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! –  Shiki Jun 21 '12 at 20:18
add comment

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 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.