I am trying to create a script to send print to a com port ESC/POS printer.
The VB commands that EPSON say use are
Public Sub cmdPrint()
Dim sPrinter As String
sPrinter = "COM1:" 'local printer
Open sPrinter For Output As #1
Print #1, Chr$(27) & Chr$(64) 'ESC @ = initialize printer
Print #1, "Page 1 - Line1" 'printing lines
Print #1, "Page 1 - Line2"
Print #1, "Page 1 - Line3"
Print #1, "Page 1 - Line4"
Print #1, "Page 1 - Line5"
Print #1, Chr$(12) 'Form feed [FF]: page break (doesnt work!)
Print #1, "Page 2 - Line1"
Print #1, "Page 2 - Line2"
Print #1, "Page 2 - Line3"
Print #1, "Page 2 - Line4"
Print #1, "Page 2 - Line5"
Close #1
End Sub
But MS doesn`t seem to like any of the PRINT lines?
POS Printers
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
That's VB. That's a different language altogether. Macro Scheduler supports Microsoft VBScript. But Microsoft VBScript is not the same as Microsoft VB.
Try this:
Try this:
Code: Select all
VBSTART
VBEND
VBEval>Chr(27),ch_Esc
VBEval>Chr(12),ch_FormFeed
WriteLn>COM1:,result,%ch_Esc%@
WriteLn>COM1:,result,Page 1 - Line1
WriteLn>COM1:,result,Page 1 - Line2
WriteLn>COM1:,result,Page 1 - Line3
WriteLn>COM1:,result,Page 1 - Line4
WriteLn>COM1:,result,Page 1 - Line5
WriteLn>COM1:,result,ch_FormFeed
WriteLn>COM1:,result,Page 2 - Line1
WriteLn>COM1:,result,Page 2 - Line2
WriteLn>COM1:,result,Page 2 - Line3
WriteLn>COM1:,result,Page 2 - Line4
WriteLn>COM1:,result,Page 2 - Line5
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?