Change selected printer
Temporarily change the currently selected (default) printer within your VB program
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
Public Function SetDefaultPrinter(ByVal DeviceName As String) As Boolean
Dim prThis As Printer
If Printers.Count > 0 Then
'\\ Iterate through all the installed printers
For Each prThis In Printers
'\\ If the desired one is found
If prThis.DeviceName = DeviceName Then
Set Printer = prThis
SetDefaultPrinter = True
'\\ Stop searching
Exit For
End If
Next prThis
End If
End Function
Original Comments (3)
Recovered from Wayback Machine