Skip to main content

[archive] Changing the printer

  • February 17, 2010
  • 4 replies
  • 0 views

[Migrated content. Thread originally posted on 17 February 2010]

OK, I'm clearly having a 'bad brain day' here...

I have a situation where I want to print to a specific printer in some circumstances from a program. I then want to change back to print to the Windows default printer (without user interaction).

It happens that I can most easily set the specific printer using the "-Q ...." option, so I have the printer ASSIGNed to a variable. Normally that variable holds "-P SPOOLER".

When I want the other printer, I use WINPRINT-GET-PRINTER-INFO-EX, an save the settings to a buffer. I then move "-Q ..." to the variable before opening the file, which works very well. Then, after closing the file, I move "-P SPOOLER" back to the variable, and use WINPRINT-SET-PRINTER-EX with the saved buffer.

I thought that should reselect the original printer, but it actually seems to leave the "alternate" printer selected. Am I just getting old? :confused:

4 replies

[Migrated content. Thread originally posted on 17 February 2010]

OK, I'm clearly having a 'bad brain day' here...

I have a situation where I want to print to a specific printer in some circumstances from a program. I then want to change back to print to the Windows default printer (without user interaction).

It happens that I can most easily set the specific printer using the "-Q ...." option, so I have the printer ASSIGNed to a variable. Normally that variable holds "-P SPOOLER".

When I want the other printer, I use WINPRINT-GET-PRINTER-INFO-EX, an save the settings to a buffer. I then move "-Q ..." to the variable before opening the file, which works very well. Then, after closing the file, I move "-P SPOOLER" back to the variable, and use WINPRINT-SET-PRINTER-EX with the saved buffer.

I thought that should reselect the original printer, but it actually seems to leave the "alternate" printer selected. Am I just getting old? :confused:
As you were! I AM getting old... :D

I should have been using WINPRINT-GET-CURRENT-INFO-EX.

[Migrated content. Thread originally posted on 17 February 2010]

OK, I'm clearly having a 'bad brain day' here...

I have a situation where I want to print to a specific printer in some circumstances from a program. I then want to change back to print to the Windows default printer (without user interaction).

It happens that I can most easily set the specific printer using the "-Q ...." option, so I have the printer ASSIGNed to a variable. Normally that variable holds "-P SPOOLER".

When I want the other printer, I use WINPRINT-GET-PRINTER-INFO-EX, an save the settings to a buffer. I then move "-Q ..." to the variable before opening the file, which works very well. Then, after closing the file, I move "-P SPOOLER" back to the variable, and use WINPRINT-SET-PRINTER-EX with the saved buffer.

I thought that should reselect the original printer, but it actually seems to leave the "alternate" printer selected. Am I just getting old? :confused:
Tsk, Tsk, ;-)

[Migrated content. Thread originally posted on 17 February 2010]

OK, I'm clearly having a 'bad brain day' here...

I have a situation where I want to print to a specific printer in some circumstances from a program. I then want to change back to print to the Windows default printer (without user interaction).

It happens that I can most easily set the specific printer using the "-Q ...." option, so I have the printer ASSIGNed to a variable. Normally that variable holds "-P SPOOLER".

When I want the other printer, I use WINPRINT-GET-PRINTER-INFO-EX, an save the settings to a buffer. I then move "-Q ..." to the variable before opening the file, which works very well. Then, after closing the file, I move "-P SPOOLER" back to the variable, and use WINPRINT-SET-PRINTER-EX with the saved buffer.

I thought that should reselect the original printer, but it actually seems to leave the "alternate" printer selected. Am I just getting old? :confused:
Tsk, Tsk, ;-)

[Migrated content. Thread originally posted on 17 February 2010]

OK, I'm clearly having a 'bad brain day' here...

I have a situation where I want to print to a specific printer in some circumstances from a program. I then want to change back to print to the Windows default printer (without user interaction).

It happens that I can most easily set the specific printer using the "-Q ...." option, so I have the printer ASSIGNed to a variable. Normally that variable holds "-P SPOOLER".

When I want the other printer, I use WINPRINT-GET-PRINTER-INFO-EX, an save the settings to a buffer. I then move "-Q ..." to the variable before opening the file, which works very well. Then, after closing the file, I move "-P SPOOLER" back to the variable, and use WINPRINT-SET-PRINTER-EX with the saved buffer.

I thought that should reselect the original printer, but it actually seems to leave the "alternate" printer selected. Am I just getting old? :confused:
Tsk, Tsk, ;-)