Solved

Direct Print to Dotmatrix with special forms control

Posted on 1998-09-02
6
206 Views
Last Modified: 2011-04-14
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?
0
Comment
Question by:dlwallac
6 Comments
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1432634
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
0
 
LVL 2

Expert Comment

by:dabellei
ID: 1432635
Each printer have their own code, do you have them?
0
 
LVL 2

Accepted Solution

by:
gikam earned 100 total points
ID: 1432636
MikeP is right
dabellei, if the printer is EPSON compatible then it shoud respect the stadard ESC/P control codes.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:dlwallac
ID: 1432637
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



0
 
LVL 2

Expert Comment

by:gikam
ID: 1432638
Before I analize the code, tell me whats the concrete problem, what is wrong?. Any error messages, or what?
IBM is different from EPSON!
0
 
LVL 2

Expert Comment

by:gikam
ID: 1432639
thanx
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question