Rocky Smolin at Beach Access Software
rockysmolin at bchacc.com
Tue Aug 7 15:57:44 CDT 2007
Think I've got it. 2003 has a printer object so it gets real easy - I
think. Seems to be working anyway.
Private Sub ChangeToRequestedPrinter()
strDefaultPrinter = Application.Printer.DeviceName
Set Application.Printer = Application.Printers("PrimoPDF")
End Sub
Private Sub ChangeToDefaultPrinter()
Set Application.Printer = Application.Printers(strDefaultPrinter)
End Sub
Rocky
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at
Beach Access Software
Sent: Tuesday, August 07, 2007 12:48 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Changing Default Printer
Dear List:
Slightly different request for changing printers to the one I had a few day
ago:
Is there an easy way to save the current windows default printer and change
to a user pre-selected printer (name stored in an local options table)?
This is for a distributable app so there's no way to know what the installed
printers are. The program needs to print to a PDF file. So the user has to
have a PDF printer installed. They pre-select it through a combo box on a
control panel loaded with all the installed printer names and the printer
name is saved in a local table. The app then runs at night without user
intervention triggered by windows scheduler. So when it runs these reports,
I need it to change the windows default printer to whatever printer they
select. And then change it back after I'm done printing.
MTIA
Rocky
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.11.8/940 - Release Date: 8/6/2007
4:53 PM