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:[EMAIL PROTECTED]
On Behalf Of Dekky Liu
Sent: Wednesday, July 04, 2007 3:21 PM
To: [email protected]
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]