Hi,
I've just tried that using the following and I'm able to print to it.
VB Code:
Private Sub Command1_Click() Dim P As Object For Each P In Printers If P.Port = "COM1:" Then Set Printer = P Exit For End If Next P Printer.Print "Hello" Printer.EndDoc End Sub
Below is an example I found in the EPSON ESC/POS FAQ...
VB Code:
PRINT #1, CHR$(&H1B);"@"; 'Initializes the printer (ESC @) PRINT #1, CHR$(&H1B);"a";CHR$(1);'Specifies a centered printing position (ESC a) PRINT #1, CHR$(&H1B);"!";CHR$(0); 'Specifies font A (ESC !) PRINT #1, "January 14, 2002 15:00"; PRINT #1, CHR$(&H1B);"d";CHR$(3); 'Prints and 3 line feeding (ESC d) PRINT #1, CHR$(&H1B);"a";CHR$(0); 'Selects the left print position (ESC a) PRINT #1, CHR$(&H1B);"!";CHR$(1); 'Selects font B PRINT #1, "TM-U210B $20.00";CHR$(&HA); PRINT #1, "TM-U210D $21.00";CHR$(&HA); PRINT #1, "PS-170 $17.00";CHR$(&HA); PRINT #1, CHR$(&HA); 'Line feeding (LF) PRINT #1, CHR$(&H1B);"!";CHR$(17); 'Selects double-height mode PRINT #1, "TOTAL $58.00"; CHR$(&HA); PRINT #1, CHR$(&H1B);"!";CHR$(0); 'Cancels double-height mode PRINT #1, "------------------------------";CHR$(&HA); PRINT #1, "PAID $60.00";CHR$(&HA); PRINT #1, "CHANGE $ 2.00";CHR$(&HA); PRINT #1, CHR$(&H1D);"V";CHR$(66);CHR$(0); 'Feeds paper & cut
I tried sending this to the printer by changing 'PRINT #1' to 'Printer.Print', it got there but took a long time, and not fully.
In the FAQ it just shows the above as an example, how do I get the above sent to the printer?
Also the printer object is fine, if the printer is installed. But what if the printer is just attached to COM1, but not installed in windows and the COM settings are being read in from an ini file?
Regards




Reply With Quote