View Single Post
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How do I make a single document from another 500 by appending cont

The boiler.dot add-in you can download from my web site will allow you to
assemble the documents in any order you like and choose whether you want
each in a new section before inserting them in the current document.

The following macro will simply insert each Word document, from a folder you
select, one after another. If there is no docu8ment open it will create one
based on normal.dot.

Note unless all the short documents are based on the same template, this
document will be a formatting jungle.

Sub BatchInsert()
Dim myFile As String
Dim PathToUse As String
Dim MyDoc As Document

With Dialogs(wdDialogCopyFile)
If .Display 0 Then
PathToUse = .Directory
Else
MsgBox "Cancelled by User"
Exit Sub
End If
End With
If Documents.Count = 0 Then
Documents.Add
End If
If Left(PathToUse, 1) = Chr(34) Then
PathToUse = Mid(PathToUse, 2, Len(PathToUse) - 2)
End If
myFile = Dir$(PathToUse & "*.do?")
While myFile ""

Selection.InsertFile myFile

myFile = Dir$()
Wend
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Costi ANDRITOIU wrote:
Hi there,
I wonder if you guys can help me... How do I make a single word
document from another let's say 500 or 1000 documents by appending
their content? I have one folder with more that 400 small word
documents, smaller than 1/2 page, and I want to append them in a
single file, programatically. It doesn't matter the order of the
documents that are appended.
Any help will be appreciated.
Thanks.