|
-
Nov 29th, 2000, 11:57 AM
#1
Thread Starter
New Member
I want an app to only change the printer default within the application. If I use the common dialog, I can set .defaultprinter=False to stop the Windows default printer from changing, but then my local printer isn't changed either!
Code:
Private Sub mnuFPrtSetup_Click()
cmdlg.PrinterDefault = False
cmdlg.Flags = cdlPDPrintSetup
cmdlg.ShowPrinter ' display Printer Setup cdlg box.
VPrint.DeviceName = Printer.DeviceName
End Sub
What can I do to change printers and not change windows defaults?
-
Nov 29th, 2000, 01:30 PM
#2
Member
I think all that you can do is to get the default printer in a variable, select the printer with the commondialog control (which then set the default to the printer that you have selected) and set the default printer back to the printer in the variable when you are done.
-
Nov 30th, 2000, 09:35 AM
#3
Thread Starter
New Member
I guess I need more help. If I change the printer within the app, I don't want the user to have to change it each time the app is opened, and I also don't want it to change the Windows default printer. What are some standard ways of persistence, either in the registry or in a database? Does anyone have working examples of this? I apologize for my lameness, but everything I have tried ultimately changes the windows default, which is unacceptable.
-
Nov 30th, 2000, 09:48 AM
#4
Frenzied Member
No problemo!
Code:
Private sDefaultPrinter$
Private Sub Form_Load()
sDefaultPrinter = GetSetting (app.Title, "Options", "DefaultPrinter")
if sDefaultPrinter = "" Then
cmdlg.PrinterDefault = False
cmdlg.Flags = cdlPDPrintSetup
cmdlg.ShowPrinter ' display Printer Setup cdlg box.
VPrint.DeviceName = Printer.DeviceName
sDefaultPrinter = VPrint.DeviceName
End Sub
Private Sub Form_Unload(Cancel As Integer)
SaveSetting app.Title, "Options", "DefaultPrinter", sDefaultPrinter
End Sub
Hope you can work it out
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|