To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example shows a quick way to provide the user a list of print available and set a default one.
Description
Printing a document from LabVIEW doesn't particularly offer many options, and it's notably hard to select one printer, or to even have a listing of the available printers. Some functions in windows provide a such listing, and enable a user to select a default printer.
The attached VI searches for all the available printers, and outputs a listing of those letters. The index command allows the user to select which printer has to be the default one (index =0 => default printer = first one to be listed).
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Snippet
**This document has been updated to meet the current required format for the NI Code Exchange.**
Eric M. - Senior Software Engineer
Certified LabVIEW Architect - Certified LabVIEW Embedded Systems Developer - Certified LabWindows™/CVI Developer
Neosoft Technologies inc.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Hey Eric,
Thaks for digging through the classes to return the info. Great for someone to use in their own code. One piece of feedback that most code will include is to keep the current settings (ie read back the current printer and set that as the default printer again or some variation there in). Currently, the only way to not change your current settings would be to pass an index outside of the range of printer indicies. Just some food for thought.
I agree with Barney, I set the index default to -1 and got rid of the annoying out of range dialog
Thanks for Eric. M, it is very useful. I use the code with following modification. Just for your info.
Worked fine for me, just what I needed. Thanks for sharing