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.

Recommended Answers

All 6 Replies

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.

your welcome... actually your last problem is easy to solve... me myself have no idea how before you raise that question... all u hav to do is search into the net.. try goggle!!! its easy really..

so heres the link for you..
http://www.samspublishing.com/library/content.asp?b=STY_VB6_24hours&seqNum=132&rl=1

im willing to help but maybe next time try to solve it first before asking for any help..

ok??? pls dont be offended..

Hello vbcnew,

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.