[02/03] Set Print Location
I'm trying to change my printer from the default to the one i select in my combobox. For some reason when using the code below the printed document is going to the default printer and the one selected in the combobox.
code i'm using to change the printer
Code:
Private Sub comboInstalledPrinters_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles comboInstalledPrinters.SelectedIndexChanged
' Set the printer to a printer in the combo box when the selection changes.
Dim printdoc As PrintDocument = New PrintDocument
If comboInstalledPrinters.SelectedIndex <> -1 Then
' The combo box's Text property returns the selected item's text, which is the printer name.
printDoc.PrinterSettings.PrinterName = comboInstalledPrinters.Text
End If
End Sub
code i'm using to do the printing
Code:
Private Sub PrintLetter(ByVal I As Integer)
Dim psi As New ProcessStartInfo
psi.UseShellExecute = True
psi.Verb = "print"
psi.WindowStyle = ProcessWindowStyle.Hidden
psi.FileName = ("C:\MedicarePrint\" & I & ".PDF")
Process.Start(psi)
End Sub