VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Set a Printer as default from Printers collection

by Vincent Lozada (3 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (5 Votes)

Attempting to set the default printer to an object variable has no effect. For instance, given a system with more than one printer installed, the following code will not change the default printer: Set Printer = Printers(2). The expected behavior is that the document should print to the first non-default printer found in the printers collection. The actual behavior is that the document prints to the original default printer. Thus, a fix was proposed in MSDN Article ID Q167735. I modified this code from it original and wrapped in a class for the purpose of storing the original printer configuration during class initialization and reseting it back during termination if it was modified.

Rate Set a Printer as default from Printers collection

Download Set a Printer as default from Printers collection

Download Set a Printer as default from Printers collection (6 KB)

Set a Printer as default from Printers collection Comments

No comments have been posted about Set a Printer as default from Printers collection. Why not be the first to post a comment about Set a Printer as default from Printers collection.

Post your comment

Subject:
Message:
0/1000 characters