Home > Posts > Multiple Word documents concatenation (using VBScript / Windows Script Host)

Multiple Word documents concatenation (using VBScript / Windows Script Host)

The tranXform free transformations software collection has been enhanced with a Microsoft Word documents concatenation script, called DOCmerge. Copying its simple usage instructions here:

Add multiple .DOC (or also .TXT etc.) files at the “docs” folder, named alphabetically in the order you wish them to be concatenated (say add a numeric prefix to their name).

Drag-drop the “docs” folder you wish to merge onto the DOCmerge.vbs file in order to get a Word file with the same name as the folder, but with the suffix “_CONCATENATED”.

Important note: page layout of different sections/pages is not respected by the above script, so either fix the page/section formatting by hand (create section breaks where needed and change page layout for those sections you want to layout say horizontally [landscape] instead of vertically [portrait]). Can also try uncommenting “word.Selection.PasteAndFormat wdPasteDefault” by removing the ‘ in front of it and commenting the next line instead, in case that action also copy/pastes page orientation (haven’t tried it and find it unlikely though). Doing that change will render the script non-workable at older Word versions though. To fix this issue a total rewrite of the script is needed to enumerate all sections and copy text per section, also reading and setting the section orientation and whatever other section layout settings from the source file to the target file.

Requirements: you must have Microsoft Office and WSH (Windows Scripting Host) installed. If you don’t have WSH (it’s preinstalled at recent Windows versions), you can download WSH from Microsoft

(C)opyright 2009 – Zoomicon / George Birbilis
Free to use / give due credit

 

Advertisements
Categories: Posts Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: