Assuming that the printer responds to a special series of commands - usually printer control commands start with ascii 27
the Escape character.
Based on this idea there is an Escape() api that lets you send any string directly to the printer instead of thru GDI - which normally talks to the printer. Use PASSTHRU to let the whole sequence go to the printer.
Your problem is finding out what the sequence is - I do not know.
You will have to play with this code to get what you need.
Code:Private Declare Function Escape Lib "gdi32" _ (ByVal hdc As Long, ByVal nEscape As Long, ByVal nCount As Long, _ ByVal lpInData As String, lpOutData As Any) As Long Private Const PASSTHROUGH = 19 Sub Cleanit() Dim tmp as String tmp = Chr(27) & "some cleaning string" Escape Printer.hdc, PASSTHROUGH, Len(tmp), tmp, 0& End Sub




Reply With Quote