Printing with Visual Basic Net

A

Thread Starter

Andy

Can anyone help me here - what should seem like a simple task is beating me. I have written a console program in VB.net and all i want it do when it sees a text file is to print it straight to the printer. however, i cannot seem to find any help on this matter. it seemed like it was easy easy in VB6, but now they seem to have removed the printer object. please any ideas!! I'm only a novice at software.
 
you should be able to glean from this snippet used in a Forms application...

Private Sub print1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles print1.Click

Try

AddHandler PrintDocument1.PrintPage, AddressOf Me.PrintDocument1_PrintPage

PrintDocument1.Print()

Catch ex As Exception

MessageBox.Show("An error occurred while printing", _

ex.ToString())

End Try

End Sub
 
My advise would be to go to msdn.microsoft.com, and do a search on "vb.net printing". The first entry I got referenced several "Quickstarts", sample programs that are distributed on the VB.NET CD. I saw several listed that deal with printing.

When faced with doing something new using VB, I generally turn to MSDN first, then do a general internet search.
 
Thread starter Similar threads Forum Replies Date
M Computing 3
F General Automation Chat 3
J Power Generation 2
J Computing 3
D Power Generation 1
Top