Con questo codice dovresti poter mostrare in una combo tutte le stampanti collegate al tuo computer e poi scegliere da li.
Public Sub Form_Open()
Dim sNomeStampante, s As String
Dim i, iA As Integer
sNomeStampante = Printer.Default
If sNomeStampante = "" Then
sNomeStampante = "Nessuna stampante"
Endif
' Riepe la combo con i nomi delle eventuali stampanti.
' Qui potrei controllare all'avvio e se non ce ne sono evitare di mostrare fax e stampanti pdf
For i = 0 To Printer.List.Count - 1
s = Printer.List[i]
' Controllo che non siano false stampanti (fax o pdf).
iA = RInStr(UCase$(s), "FAX")
If iA = 0 Then
iA = RInStr(UCase$(s), "PDF")
If iA = 0 Then
ComboBox1.Add(s, i)
End If
Endif
Next
If sNomeStampante <> "Nessuna stampante" Then
ComboBox1.Text = sNomeStampante
Endif
End
:ciao: