merging large numbers of Word files.

  • Thread starter Thread starter Vic
  • Start date Start date
V

Vic

I have Windows XP 5.1 and Office 2002.
I have almost 200 one-page Word Documents
How can I merge these into a single document?
I have tried "choosing" the documents to be merged in
Windows Explorer" , copying the selected list, and saving
the chosen document in a Word file. Starting with about
100 documents, at most only 5 or 6 will be saved in the
Word file.

Got any ideas?
Thnks, Vic
 
If you are particular about the order in which the documents are combined,
you will need to have them saved with filenames that include a numeric
portion that corresponds to the order of the document. You can then use
this information was posted quite some time back by fellow MVP Ibby:

Quote
If you need to insert the files in the
order of the numbers at the start of the filename, the following may work
better. This example uses the InsertFile command and adds a hard page break
between the files. If your documents have anything in the header/footer, you
will need to add code to unlink each header/footer from the previous.

---------------------------------------------------------

Public Sub InsertFiles()

Dim myDir As String
Dim x As Long
Dim strX As String
Dim file As String

myDir = "C:\My Extract"

For x = 1 To 162

strX = Format(x, "000")

file = Dir(myDir & "\" & strX & "*.doc")

With Selection
.Collapse wdCollapseEnd
.InsertFile myDir & "\" & file
.InsertBreak wdPageBreak
End With

Next x

End Sub

Unquote

You will need to modify the code to suit the format of your filenames.

If you are nor worried about the order, you can make use of the Dir()
function in much the same way that it is used in the code in the article at
http://word.mvps.org/FAQs/MacrosVBA/PrintAllDocsInFldr.htm

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
There's a utility on the downloads page of my web site - boiler.zip - aimed
at exactly this sort of task. You can choose the order to insert the files.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Back
Top