Suzanne, with apologies to you and Doug, the macro in the second article isn't
going to help Ricki very much -- it prints the documents to a .prn file. If all
you want is a printed copy of the combined document, then you can use the
instructions in
http://askbobrankin.com/printing_a_prn_file.html to print the
..prn file. If you want an editable document, because you need to do formatting
such as setting the heading style to "Page break before", then this macro is
useless except as an example to someone who understands how to write and adapt a
macro.
The following macro takes the list of document names and compiles those
documents into one big document. You'll need to insert the real paths and file
names into the macro where indicated by the three "set this" comments. Before
you run this macro, read through the list of document names and make sure
they're in the order you want them to appear in the final document.
Sub CollectDocumentsIntoOne()
Dim DestDoc As Document
Dim SrcDoc As Document
Dim oRg As Range
Dim NamesFile As String
Dim DestName As String
Dim oPara As Paragraph
Dim MyPath As String
Dim MyName As String
' set this to the full path and name of the file
' that contains the list of document names:
NamesFile = "C:\SomeFolder\Includes.doc"
' set this to the path of the folder (with final backslash)
' that contains the files named in the list:
MyPath = "C:\SomeFolder\Letters\"
' set this to where you want the final document
' to be saved
DestName = "C:\SomeFolder\BigDoc.doc"
Set SrcDoc = Documents.Open(NamesFile)
Set DestDoc = Documents.Add
DestDoc.SaveAs FileName:=DestName
Set oRg = DestDoc.Range
oRg.Collapse wdCollapseEnd
For Each oPara In SrcDoc.Paragraphs
If Len(oPara.Range.Text) > 5 Then
' name must be at least one char plus ".doc¶"
MyName = oPara.Range.Text
MyName = Left$(MyName, Len(MyName) - 1)
On Error Resume Next
oRg.InsertFile FileName:=MyPath & MyName, _
ConfirmConversions:=False, Link:=False
If Err.Number = 0 Then
DestDoc.Save
Set oRg = DestDoc.Range
oRg.Collapse wdCollapseEnd
End If
End If
Next oPara
SrcDoc.Close SaveChanges:=wdDoNotSaveChanges
End Sub