need help with AutoOpen print macro on mail merge document

B

bcochranmsa

We use an application which allows us to generate and print mail merge
documents via Word. As near as I can tell, trying to print a mail
merge document via this application opens Word, populates the merge
fields with the appropriate data, then prints the document to the
system default printer.

One such document we use is a label document, and we use the following
AutoOpen macro to divert the print job to their label printer without
making them change their default printer each time:

Sub AutoOpen()
Application.WordBasic.FilePrintSetup Printer:="Dymo LabelWriter 330
Turbo-USB", _
DoNotSetAsSysDefault:=1
End Sub

With this macro in place, the document is opened, the data is merged,
and it's printed to the label printer. In most situations, this is
adequate. However, we've been getting requests from people who want
to be able to specify how many copies to print, and I've been having a
lot of trouble figuring out how to make that happen.

I've tried various methods of showing the print dialog box, so they
could specify how many copies to print and be happy. Unfortunately,
any time I've been able to get the print dialog box to pop up with
AutoOpen, it will print the mail merge document before the data is
merged in (it prints the merge field names rather than the data). If
I tell the print dialog to print 3 copies, it will print 3 copies of
the pre-merged document, then print one copy of the merged document.

I'm pretty new to WordBasic and macros, and basically gave myself a
crash course yesterday. I had also tried using an inputbox to prompt
for the number of copies, then try to pass that to FilePrint (I
think... I tried so many different things it's hard to keep track now)
using the NumCopies argument, but that just resulted in errors. I'm
open to suggestions at this point.

Unfortunately, I have no control over the program that actually
invokes Word to open and print the mail merge document, so I'm
basically limited to what I can do with macros during the brief period
the document is opened.
 

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