Home  |   French  |   About  |   Search  | mvps.org  

What's New
Table Of Contents
Credits
Netiquette
10 Commandments 
Bugs
Tables
Queries
Forms
Reports
Modules
APIs
Strings
Date/Time
General
Downloads
Resources
Search
Feedback
mvps.org

In Memoriam

Terms of Use


VB Petition

Reports: Change printers from code

Author(s)
Dev Ashish

(Q)    How can I change a report's printer programmatically?

(A)    In order to change printer information, you must use APIs.

The PrtDevNames property stores the name of the printer, and the PrtDevMode property stores the driver information. Both of these properties need to be changed in order to change the printer driver. If the PrtDevMode property does not match the PrtDevNames property (that is, the PrtDevMode property describes a different driver than the PrtDevNames property) a General Protection (GP) Fault may occur.

Visit these links for more details and solutions.

    How to Change a Report's Printer Using Code (MS KB)

    Controlling your printer (MS KB)

Download the code (DefaultPrt.zip) from here (Courtesy of Ken Getz). 

or, if you need ready code to pop into your application,

    On The Fly Printing (ATTAC Group)


© 1998-2010, Dev Ashish & Arvin Meyer, All rights reserved. Optimized for Microsoft Internet Explorer