LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Printer selection

LabVIEW normally prints to the default printer. Can anyone help with a vi to select the printer before printing the frontpanel or diagram in an application?

Peter Vijn, Organon Newhouse, Scotland
0 Kudos
Message 1 of 7
(4,777 Views)
Hi Peter,
a way to do it is to use Windows API.
- for Win95, use OpenPrinter()/SetPrinter()
- for 3.1/95/NT use WriteProfileString()
You can find details in MSDN Library - articles Q135387 and Q140560.
0 Kudos
Message 2 of 7
(4,777 Views)
I got this VI from the Developer Exchange.
Message 3 of 7
(4,777 Views)
Thanks a lot Dennis for this useful routine. It works fine, the only problem is that the diagram is password protected. Do you know whom to contact for the source code?
0 Kudos
Message 5 of 7
(4,777 Views)
Nope. I just use it as is.
0 Kudos
Message 7 of 7
(4,777 Views)
I got this VI from the Developer Exchange.
0 Kudos
Message 4 of 7
(4,777 Views)
These 2 VIs uses ActiveX calls to get the printer list and set the default
printer.

Jean-Pierre Drolet
Scientech R&D

"Peter Vijn" a ?crit dans le message news:
506500000008000000F4290000-998975444000@exchange.ni.com...
> LabVIEW normally prints to the default printer. Can anyone help with a
> vi to select the printer before printing the frontpanel or diagram in
> an application?
>
> Peter Vijn, Organon Newhouse, Scotland



[Attachment GetPrintersList.vi, see below]


[Attachment SetDefaultPrinter.vi, see below]


LabVIEW, C'est LabVIEW

Download All
Message 6 of 7
(4,777 Views)