Kalo pake dua printer, yang dot matrix coba dijadikan default printer.
Perintah awal tetap seperti ini: Open Printer.Port For Input As #1 ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Dekky Liu Sent: Wednesday, July 04, 2007 3:54 PM To: [email protected] Subject: Re: [indoprog-vb] HELP: Cara Pakai Open Printer.port Error 52 Terima kasih sebelumnya untuk Mas Rosadi dan Mas Ronald, saya sudah coba dengan perintah : Open "USB001:" For Output As #1 Printer.Width = 20000 Printer.CurrentX = 0 Printer.CurrentY = 0 Printer.ScaleMode = vbCentimeters Printer.FontName = "Arial" Printer.FontSize = 8 Printer.FontBold = True Printer.Print Tab((45 - Len(Trim(NamaToko))) / 2); Trim(NamaToko) Printer.Print Tab((45 - Len(Trim(Alamat))) / 2); Trim(Alamat) Close #1 Tetap Error : "Runtime Error : 52, Bad file name or number.". Kalau USB001: nya saya rubah ke lpt1:, error msg nya : "Runtime Error : 53, File not found." Spec PC saya : WinXP, Printer Epson C43UX (port USB001, inkjet), VB 6.0 Tujuan : Saya ingin printer saya Epson LX-300 (dot matrix) bisa print struck dan tidak rolling keatas sewaktu print selesai. Jadi hanya print sampai baris terakhir dan head printer berhenti disana, jangan rolling ke halaman baru. Saya test di printer Epson inkjet saya ini sekarang. Terima kasih banyak ya .. Mohon pencerahannya. ----- Original Message ----- From: Rosadi, Edi To: [email protected] <mailto:indoprog-vb%40yahoogroups.com> Sent: Wednesday, July 04, 2007 3:42 PM Subject: RE: [indoprog-vb] HELP: Cara Pakai Open Printer.port Error 52 Coba dengan susunan perintah berikut : Open Printer.Port For Input As #1 Printer.Width = 20000 Printer.CurrentX = 0 Printer.CurrentY = 0 Printer.ScaleMode = vbCentimeters Printer.FontName = "Arial" Printer.FontSize = 8 Printer.FontBold = True Printer.Print Tab((45 - Len(Trim(NamaToko))) / 2); Trim(NamaToko) Printer.Print Tab((45 - Len(Trim(Alamat))) / 2); Trim(Alamat) Printer.Print Tab((45 - Len(Trim("Telp. " + Telpon))) / 2); Trim("Telp. " + Telpon) Close #1 ________________________________ From: [email protected] <mailto:indoprog-vb%40yahoogroups.com> [mailto:[email protected] <mailto:indoprog-vb%40yahoogroups.com> ] On Behalf Of Dekky Liu Sent: Wednesday, July 04, 2007 3:21 PM To: [email protected] <mailto:indoprog-vb%40yahoogroups.com> Subject: [indoprog-vb] HELP: Cara Pakai Open Printer.port Error 52 Hallo Pak Masino Hallo para senior, begini nih, bisa tolong bantu saya tidak ya .. saya mau print struck dari vb 6.0 tetapi saya ingin printer saya tidak rolling terus setelah baris terakhir telah ter print. Saya pernah baca harus menggunakan perintah open dan close : ---------------------------------------------------------- Printer.EndDoc '<-- This will eject the paper till the end ' of paper 'If you don't want printer roll up the paper till the end, 'you can use the following code. The printer head will be stop 'just after printing the last line in richtexbox control 'Here is the code: 'Open Printer.Port For Input As #1 ' Printer.Print rtfLap1.Text 'Close #1 ---------------------------------------------------------- saya berusaha mencobanya dengan FOR INPUT atau FOR OUTPUT, tetapi terus gagal dengan ERROR 52. bisa tolong dibantu gak ya. Ini potongan script command_click print saya : ---------------------------------------------------------- Private Sub cmdCetak_Click() . SQL = "SELECT * FROM KasirDetil WHERE NoBukti = '" & txtNoBukti & "'" Set rs = db.OpenRecordset(SQL) If rs.EOF Or rs.BOF Then JumRec = 0 Else rs.MoveLast JumRec = rs.RecordCount End If rs.MoveFirst Printer.Width = 20000 Printer.CurrentX = 0 Printer.CurrentY = 0 Printer.ScaleMode = vbCentimeters Printer.FontName = "Arial" Printer.FontSize = 8 Printer.FontBold = True Printer.Print Tab((45 - Len(Trim(NamaToko))) / 2); Trim(NamaToko) Printer.Print Tab((45 - Len(Trim(Alamat))) / 2); Trim(Alamat) Printer.Print Tab((45 - Len(Trim("Telp. " + Telpon))) / 2); Trim("Telp. " + Telpon) Printer.NewPage Printer.EndDoc . . Exit Sub ---------------------------------------------------------- Bagaimana ya saya embed perintah open printer.port dan close nya itu di dalam script saya diatas ini, saya sudah mencoba berbagai cara juga masih belum bisa .. tolong dibantu ya mas. Thx a lot. NOTICE - This message and any attached files may contain information that is confidential and intended only for use by the intended recipient. If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, be advised that you have received this message in error and that any dissemination, copying or use of this message or attachment is strictly forbidden, as is the disclosure of the information therein. If you have received this message in error please notify the sender immediately and delete the message. [Non-text portions of this message have been removed] NOTICE - This message and any attached files may contain information that is confidential and intended only for use by the intended recipient. If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, be advised that you have received this message in error and that any dissemination, copying or use of this message or attachment is strictly forbidden, as is the disclosure of the information therein. If you have received this message in error please notify the sender immediately and delete the message. [Non-text portions of this message have been removed]
