Printing with a Word macro

T

TheGrimbler

I have written an Excel macro that collects information, then calls a Word
document and a macros that completes a form letter. Then the Word macro
gives the user a chance to:
- print a copy of a letter and/or
- print an envelope
It worked wonderfully for the past several months, but now the macro will
either print the letter or the envelope but not both of them anymore.

Could it be the print spooler will not accept 2 documents back to back? Is
there a way I can insert a timer that would allow the first document to print
and then send the 2nd document to the printer, then close the Word document
and return to Excel?

Help, please.

Thanks.

TheGrimbler
 
D

Doug Robbins - Word MVP

Without seeing the code of the macro, there is no way to tell.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
T

TheGrimbler

I figured out a "work around" -- I added a 5 second "delay timer" in the
Excel macro.
Delay = 5
'Give printer time to receive file and print before closing Word
document
TheTime = Timer
'Timer is a system function
Do
Loop Until (Timer - TheTime) >= Delay

WordApp.Quit savechanges:=wdDoNotSaveChanges 'closes letter document
Set WordApp = Nothing
'closes Word application


This gives the printer time to print both documents before the Excel macro
closes. I don't know why the print queue does not process as it normally
does, even though the application is closed. Background printing box is
checked but that doesn't seem to matter.

So I am no smarter than I was before, just fell into a "work around"

The Grimbler
 
H

Helmut Weber

Hi,

make sure that background printing is set to false.
Otherwise you run into problems with multitasking.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top