Printing a Word Document Automatically

S

Steve

Good Afternoon,
I have a Word document which uses a mail merge from a
query in Access. I am trying to schedule Word to print the
data automatically at some time overnight. Is there anyway
to do this? The file can be large at times and it takes
some time to print so I would rather be able to walk in to
all the printouts on my printer first thing in the morning.

Thanks,
Steve
 
P

Peter Jamieson

As long as you can safely leave your PC on with Word open, you could
a. open your Mail Merge Main document
b. use a very simple timer macro to wait until the time you want to print,
then execute the print, e.g. at its very simplest

Sub MergeLater()
' Let's start at 2 A.M.
Do While Left(TIME, 4) <> "2:00"
DoEvents
Loop
Activedocument.Mailmerge.Execute
End Sub

However, older versions of Word will show the print dialog when you do that
so in that case you would need to mere to an output document, then print
that. And if merge to an output document does not cause the process to fail,
you could merge while you're in the office and simply print the result
overnight (using a similar technique if you want).

Alternatively, more recent versions of WIndows have a Task Scheduler that
you might be able to use to start Word at a certain time. I don't know much
about it (but e.g. in Windows 2000 look for Scheduled Tasks in Control
Panel, and notice that as far as I know you can specify a document as the
task. In that case Windows should run the associated application (Word) and
open the document. SO if you put a macro called AutoOpen in the document,
that macro should be run when the document is opened via the scheduler, and
can just do ActiveDocument.Execute. However, you would still need to
avoiding having dialogs popping up, and in this case you would have to avoid
anything popping up when Word opens or when the document opens.)
 

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