Print all documents in a given folder to a single print file

Article contributed by Bill Coan and Anna-Karin Bohman

Dim MyFile As String, MyPath As String, MyName As String

MyPath = "c:\my documents\"
MyName = Dir$(MyPath & "*.doc")
MsgBox "About to print " & MyName & "to c:\myfile.prn"

Application.PrintOut _
        Background:=False, _
        Append:=False, _
        OutputFileName:="c:\myfile.prn", _
        PrintToFile:=True, _
        FileName:=MyPath & MyName

MyName = Dir

Do While MyName <> ""
    MsgBox "About to append " & MyName & " to c:\myfile.prn"

    Application.PrintOut _
            Background:=False, _
            Append:=True, _
            OutputFileName:="c:\myfile.prn", _
            PrintToFile:=True, _
            FileName:=MyPath & MyName

    MyName = Dir
Loop