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

Join 118,589 VB Programmers for FREE! Ask your question and get quick answers from experts. There are 827 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



how to close a com port to achieve printing

 
Reply to this topicStart new topic

how to close a com port to achieve printing

uggo
post 4 Aug, 2008 - 11:30 AM
Post #1


New D.I.C Head

*
Joined: 4 Aug, 2008
Posts: 2

I try to write an application with epson pos printer (TM TI88III) ticket printer and I cannot make the printer work inside the prog, I have to end and quit the programm to get the receipt printed. Is ther a way to force the port com to print?
The sub is listed below, the close COM1: does not work or is useless.

Private Sub Form_Load()

Open "Com1:" For Output As #1

Print #1, Chr$(&H1B); "@"; 'Initialise printer
Print #1, Chr$(&H1B); "a"; Chr$(1); 'centered
Print #1, Chr$(&H1B); "!"; Chr$(0); ' font
Print #1, Date;
Print #1, Chr$(&H1B); "d"; Chr$(3); ' 3 line feed
Print #1, Chr$(&H1B); "a"; Chr$(0); 'left position

hotesse = Trim$(vendeuse.Text)
Print #1, "Hotesse: "; hotesse; Chr$(&HA);


For nb = 0 To listventes.ListCount - 1
listventes.ListIndex = nb
lineticket = listventes.Text
Print #1, lineticket; Chr$(&HA);
Next nb

Print #1, " ----------------"; Chr$(&HA);

lineticket = "TOTAL " + totpay.Text
Print #1, Chr$(&H1B); Chr$(33); Chr$(1); ' db height dbl width
Print #1, Chr$(&H1B); "!"; Chr$(17); 'dble height
Print #1, Chr$(&H1B); "!"; Chr$(33); 'dble width
Print #1, lineticket; Chr$(&HA);
Print #1, Chr$(&H1B); Chr$(33); Chr$(1); ' end dbl height

Print #1, " "; Chr$(&HA);
Print #1, Chr$(&H1B); "d"; Chr$(3); ' 3line feed before cut
Print #1, Chr$(&H1D); "V"; Chr$(66); Chr$(0); ' cut ticket

Close "Com1:"

End Sub
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/11/08 07:44PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month