-
Wait while word is printing
I have a Word document which creates a final document based on the records from access 2003 using mailmerge. I'm having problems with the printing to PDF. After debugging, I saw that because of the following code, the printing is occurring SLOWLY (~2pg/min). Some documents can be 300 pages long. I'm using this code to just tell the VBA code to wait until Word is finished printing the document to a PDF. Is there a better way to do this?
[VBA]
'-- Execute the mail merge
objWordDoc.MailMerge.Execute Pause:=False
'THIS IS WHERE IT TAKES A LONG TIME.
If objWordApp.Options.BackgroundOpen = True Then
'While jobs in queue
While objWordApp.BackgroundPrintingStatus
DoEvents
Wend
While objWordApp.BackgroundSavingStatus
DoEvents
Wend
End If
[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules