Hello,

I am developing an application in Visual Basic in which i have to enter the details of candidates and after that clicking on the print button, the details of that particular candidate get printed out without using/going to a report.
I want to know how can i do that, also i don't know anything about print command in visual basic. so, if anyone can explain me about this too.

Thanks in advance.

try this code..

Printer.print "Message"
printer.enddoc

this will directly print your text to the printer attached.( just be sure to configure the printer in the control panel) try exploring the Printer class and you can see it works.. change the CurrentX and currentY values to positon your text.

A better and most easy way to get something printed on to the printer is the following code.

Dim Str1 As String
Open "LPT1" For Output As #1
Str1="Testing the Printer"
Line Output #1 Str1
Close #1

A better and most easy way to get something printed on to the printer is the following code.

Dim Str1 As String
Open "LPT1" For Output As #1
Str1="Testing the Printer"
Line Output #1 Str1
Close #1

hello manoharan,

can you make me understand this code. or just let me know what is #1 stand for.
also, if this code will work to print the candidate details. and one more thing from where i can get notes on vb print command/ statement to understand it fully and better.

Thank you.

Hello to all,

what should i do if i want to open the print dialog box to see which printer is attached and to change the given preferences of printer etc. by clicking on the button placed on the form.

Thanks to both of you for previos replies.

Hello vbcnew,

Thanks for your reply.
I 'll look at what you said.

This question has already been answered. Start a new discussion instead.