VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Changing Windows Printer w/o using priint dialog

VB FAQ  (6 Submissions)   Windows System Services   Visual Basic 3.0   Unknown Difficulty   Wed 3rd February 2021

How can I change the printer Windows uses in code without using the print common dialog? How can I change orientation?
You can change the printer the VB 3.0 Printer object is pointing to programmatically (without using the common dialogs). Just use the WriteProfileString API call and rewrite the [WINDOWS], DEVICE entry in the WIN.INI file! VB will instantly use the new printer, when the next Printer.Print command is issued. If you get the old printer string before you rewrite it (GetProfileString API call), you can set it back after using a specific printer. This technique is especially useful, when you want to use a FAX printer driver: Select the FAX driver, send your fax by printing to it and switch back to the normal default printer.

Rate Changing Windows Printer w/o using priint dialog (42(42 Vote))
Changing Windows Printer w/o using priint dialog.bas

Changing Windows Printer w/o using priint dialog Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters