Combining multiple word documents into one
I have some code that prints out multiple word documents. It works, but when we did a full volume test, which is about 2,000 a day, the printer began skipping pieces of documents. We ramped up the memory on the printer, did not work. This VBA code is executed within an Access DB. However, when I execute it from a macro within a word document, it prints properly, but way too slow. So, I want to try to merge all the documents in to one and then try to print that.
Does anyone know how to do that within the FSO environ. I have been trying for a few hours now.
Code:
Dim wordApp As New Word.Application
Dim myDoc As Word.Document
Dim myDoc2 As Word.Document
wordApp.Visible = False
wordApp.ScreenUpdating = False
wordApp.DisplayAlerts = False
Const TARGET_FOLDER_ONEPAGE As String = "P:\Clients\Vanguard\Finance\testing\onepagedocs\"
With wordApp
Set Fso = New FileSystemObject
Set fldr = Fso.GetFolder(TARGET_FOLDER_ONEPAGE)
For Each f In fldr.Files
If Right(f.Name, 4) = ".doc" Then
Set myDoc = Documents.Open(TARGET_FOLDER_ONEPAGE & f.Name)
myDoc.PrintOut
myDoc.Merge
myDoc.Close False
End If
Next f
wordApp.Quit
End With
I had the screenupdating off to try to minimize overhead. If anyone can show me how or point me in the write direction, it would be greatly appreciated. Thanks.