VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Set a Printer as default from Printers collection

Vincent Lozada  (3 Submissions)   Windows API Call/Explanation   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

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 (5(5 Vote))

Download Set a Printer as default from Printers collection

Set a Printer as default from Printers collection Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters