Direct Print to Dotmatrix with special forms control

I need to print a special form size (7" in length) on a dotmatix printer.  I would like to be able to send control characters and text directly to the printer.  How can I best do this?
Who is Participating?
gikamConnect With a Mentor Commented:
MikeP is right
dabellei, if the printer is EPSON compatible then it shoud respect the stadard ESC/P control codes.
You can open the printer's port using Open, just as you would open file:

Open "LPT1" for output as #1

'Then, you just use Print # to send strings to it
Each printer have their own code, do you have them?
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

dlwallacAuthor Commented:
If this is what you are suggesting, it does not work.

Private Sub Command1_Click()
' Truck Bill Form Description
' Form size: 8.5 in. width, 7 in. height
' 8 lpi, 56 lines per page
' 10 characters per inch
' Using IBM ProPrinter (or any IBM control character compatible)

   Dim fa As Integer
   Dim x As Integer
   fa = FreeFile
   Open "lpt1" For Output As fa
   ' Set page size to 56 lines, 8 lines per inch
   Print #fa, Chr$(27); "C"; Chr$(56); Chr$(27); Chr$(48);
   For y = 1 To 2                       ' print 2 pages
      For x = 1 To 30                   ' print first 30 lines
         Print #fa, Format$(x, "##0")
      Next x
      Print #fa, Chr$(12);              ' eject to new page
   Next y
   Close fa
End Sub

Before I analize the code, tell me whats the concrete problem, what is wrong?. Any error messages, or what?
IBM is different from EPSON!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.