Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 01-14-2006, 20:27
mpardinho
 
Posts: n/a
Thumbs up

try this code

if you need use chr(27).....CHR(18)

Code:
Public Sub Prinbt_File(Txt$, PrnName$)
   Dim DI As DOC_INFO_1, buffer() As Byte, Written&, hPrn&
   Dim FinalText$, Addline$, Resp&
   Dim Pd As PRINTER_DEFAULTS
      
   DI.pDocName = "Relat�rio"
   DI.pOutputFile = vbNullString
   DI.pDatatype = "RAW"
   
   With Pd
      .pDatatype = 0&
      .pDevMode = 0&
      .DesiredAccess = PRINTER_ALL_ACCESS
   End With
   
   ' open
   Resp = OpenPrinter(PrnName, hPrn, Pd)
   Resp = StartDocPrinter(hPrn, 1, DI)
   Resp = StartPagePrinter(hPrn)
   
   ' print
   Open Txt For Input As #1
      Do While Not EOF(1)
         Line Input #1, Addline
         buffer = FinalText + vbCrLf
         Call WritePrinter(hPrn, buffer(1), UBound(buffer), Written)
     Loop
   Close #1
   
   ' Finish
   EndPagePrinter (hPrn)
   EndDocPrinter (hPrn)
   ClosePrinter (hPrn)
End Sub
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing tuts at work crkelbery General Discussion 3 03-04-2005 08:49


All times are GMT +8. The time now is 07:35.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )