Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 136,232 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,279 people online right now. Registration is fast and FREE... Join Now!




how to connect the different printers through vb.net

 
Reply to this topicStart new topic

how to connect the different printers through vb.net

sadanandam
14 Oct, 2008 - 01:36 AM
Post #1

New D.I.C Head
*

Joined: 14 Oct, 2008
Posts: 1

Hi,
I need to connect the different printers in network through vb.net 2005, can you please help how connect the diffrent printers in network.


Thanks
Sadanandam
User is offlineProfile CardPM
+Quote Post

ThatOtherGuy
RE: How To Connect The Different Printers Through Vb.net
14 Oct, 2008 - 11:09 PM
Post #2

New D.I.C Head
*

Joined: 13 Oct, 2008
Posts: 4


My Contributions
Hi,

Sorry but i dont really know what it is you are looking for, but here is some code on how to get a list of the printers installed on a machine.

vb

Private Sub frmPrinterSelection_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim i As Integer
Dim ioPrinter As Integer
Dim found As Boolean = False

'Add this computers avail printers to the combobox
cbbPrinters.Items.Clear()
For i = 0 To (Printing.PrinterSettings.InstalledPrinters.Count - 1)
cbbPrinters.Items.Add(Printing.PrinterSettings.InstalledPrinters.Item(i))

'Check to see if there is a IO Printer in the list
If InStr(Printing.PrinterSettings.InstalledPrinters.Item(i), "IO PRINTER") Then
ioPrinter = i
found = True
End If
Next

'There is a problem with the printer at sales this makes them choose the printer
'found = False

'If the IO printer is found on the users machine use as default and print automatical
'If not display the print form and let the user select the printer
If found Then
'Set the default printer to be the printer being used to print to
frmPlaceOrder.ioDoc.PrinterSettings.PrinterName = "IO PRINTER"

Try
frmPlaceOrder.ioDoc.Print()

'Close the form if printing to the default printer
Me.Close()
Exit Sub
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Printing Error")
End Try
End If

cbbPrinters.Focus()
End Sub


Hope this help.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 03:24AM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month