[AccessD] Change printer

Charlotte Foust cfoust at infostatsystems.com
Mon Jan 12 14:52:58 CST 2004


The GetPrinter API call will allow you to retrieve infromation on
printers and the SetPrinter API call allows you to change the settings
on a printer.  They require the use of a custom type to handle the
DevMode values, and you can find code for this at www.allapi.net and
other places.  However, you have to open the report itself in design
view in code and change the printer, since this is saved as part of the
design.  Then when you print the report, it will go to the right
printer.   We do this in our applications using the PDF printer as the
selected printer when we want to create PDF files.  That means, you have
to capture the choice before you create the PDF file, which means, you
need to decide in advance what you're going to call that file and where
you want to put it.  

Charlotte Foust

-----Original Message-----
From: Joseph O'Connell [mailto:joconnell at indy.rr.com] 
Sent: Monday, January 12, 2004 8:23 AM
To: ACCESS-L at PEACH.EASE.LSOFT.COM; AccessD at databaseadvisors.com
Subject: [AccessD] Change printer


Cross posted to Access-L and AccessD

I thought this was discussed recently, but I cannot find the solution in
the archives.

Win 2000
Access 2000

Is there an easy way to change the output device for a report?  An
application has several reports that are normally sent to a specific
printer.  Now the client wants the ability to selectively create a PDF
using Adobe Distiller and have the PDF sent as an attachment to an email
message. Because this procedure must be totally automated, having the
print dialog box popup is not a viable solution.

I know that this could be accomplished by having a second set of reports
that are already set to output to Distiller, but this would create a
maintenance problem to ensure that any changes made to a printed report
are also made to the Distiller report.  What I am looking for is code
that can change the destination to Distiller and then change it back to
the original destination after the PDF is created.

Does anyone have the code to to this?  Or can someone point me to the
API that can read and set the printer for a specific report?

Thanks.

Joe O'Connell



_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list