saya sudah coba coding di bawah ini ke vb tapi kok printer ngak bergerak/print. apa ada yang kurang di tambahin. thank's
> '------------------------------------ > ' Siapkan 1 Form dan 1 Command Button > '------------------------------------ > > Option Explicit > > Private Type DOCINFO > pDocName As String > pOutputFile As String > pDatatype As String > End Type > > Private Declare Function ClosePrinter Lib "winspool.drv" (ByVal > hPrinter As Long) As Long > Private Declare Function EndDocPrinter Lib "winspool.drv" (ByVal > hPrinter As Long) As Long > Private Declare Function EndPagePrinter Lib "winspool.drv" (ByVal > hPrinter As Long) As Long > Private Declare Function OpenPrinter Lib "winspool.drv" Alias > "OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long, ByVal > pDefault As Long) As Long > Private Declare Function StartDocPrinter Lib "winspool.drv" Alias > "StartDocPrinterA" (ByVal hPrinter As Long, ByVal Level As Long, > pDocInfo As DOCINFO) As Long > Private Declare Function StartPagePrinter Lib "winspool.drv" (ByVal > hPrinter As Long) As Long > Private Declare Function WritePrinter Lib "winspool.drv" (ByVal > hPrinter As Long, pBuf As Any, ByVal cdBuf As Long, pcWritten As Long) > As Long > > Dim lhPrinter As Long > > Private Sub Command1_Click() > Dim lReturn As Long > Dim lpcWritten As Long > Dim sWrittenData As String > sWrittenData = "How's that for Magic !!!!" & vbCrLf > lReturn = WritePrinter(lhPrinter, ByVal sWrittenData, > Len(sWrittenData), lpcWritten) > > lReturn = EndPagePrinter(lhPrinter) > lReturn = EndDocPrinter(lhPrinter) > lReturn = ClosePrinter(lhPrinter) > End Sub > > Private Sub Form_Load() > Dim lReturn As Long > Dim lDoc As Long > Dim MyDocInfo As DOCINFO > > lReturn = OpenPrinter(Printer.DeviceName, lhPrinter, 0) > If lReturn = 0 Then > MsgBox "The Printer Name you typed wasn't recognized." > Exit Sub > End If > MyDocInfo.pDocName = "AAAAAA" > MyDocInfo.pOutputFile = vbNullString > MyDocInfo.pDatatype = vbNullString > lDoc = StartDocPrinter(lhPrinter, 1, MyDocInfo) > Call StartPagePrinter(lhPrinter) > End Sub > > ------------------------ Yahoo! Groups Sponsor --------------------~--> 1.2 million kids a year are victims of human trafficking. Stop slavery. http://us.click.yahoo.com/WpTY2A/izNLAA/yQLSAA/zCsqlB/TM --------------------------------------------------------------------~-> Untuk berhenti berlangganan kirim email kosong ke : [EMAIL PROTECTED] Ikuti juga forum diskusi VB.net dengan mengirim email kosong ke [EMAIL PROTECTED] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/indoprog-vb/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
