Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print to file using Command button 1

Status
Not open for further replies.

compgeo

Technical User
Jan 31, 2001
1
US
I know how to set up a command button to print a report from a form. However, I want to "Print to File" (as if I had checked that option in the Print dialog box) instead of sending the output directly to the printer.

P.S. Send to file is NOT an option.
 
Add a new printer in the Printers folder, using the same driver as the printer you eventually want to print on. When the Printers wizard asks you what port the printer is on, choose File:. Name it anything you want. Then, any time you select that printer in an application, you'll get a dialog asking you for the file name to write to.

You may also be able to do this by manipulating the PrtDevMode and PrtMip objects, but that's quite a lot harder. Still, if you plan to distribute this to users and don't want to make them set up an additional printer, that may be your only option. I've never bothered with PrtDevMode and PrtMip, though, so you're on your own. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top