PDA

View Full Version : appending multipe .doc files into one .doc file



dbanker
02-26-2007, 09:06 AM
I'm sure this is simple, tried to do it in DOS but it only copied the last file in the list. Is there a short macro I can write to do this? Converting all .doc files to .txt files would be an acceptable step. Will ultimately put this large file into Excel and search for a phrase, copy that line of text and place into another worksheet.

Thanks...Doug

fumei
02-26-2007, 12:16 PM
Step 1. Try recording a macro to append a file.
Step 2. Look up the Dir function in Help.

Beween the two of these, you can do this.

mdmackillop
02-26-2007, 01:43 PM
Hi Doug,
Coincidentally I'm working on a project importing all Word files in a folder into Excel here (http://vbaexpress.com/forum/showthread.php?t=11642). This code could be simplified to put the text into one sheet. There's also a KB item here (http://vbaexpress.com/kb/getarticle.php?kb_id=553) which might be adapted to run from Excel to extract sentences etc. from your Word documents.