Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.
VB.Net: Selecting a printer
From Wiki
Sometimes it can be nice to select the printer you want to print on without letting the user choose the correct one.
- Public Shared Sub SelectPrinter(ByRef PrinterSettings As PrinterSettings, ByVal PrinterName As String)
- For inttemp As Integer = 1 To System.Drawing.Printing.PrinterSettings.InstalledPrinters.Count
- If System.Drawing.Printing.PrinterSettings.InstalledPrinters.Item(inttemp - 1).ToString.ToUpper = PrinterName.ToUpper Then
- PrinterSettings.PrinterName = System.Drawing.Printing.PrinterSettings.InstalledPrinters.Item(inttemp - 1).ToString
- End If
- Next
- End Sub
the above function takes the name of the printer as a parameter and also the printersettings of the object you want to use for printing or printpreviewing.



LTD Social Sitings
Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.