?
Solved

Direct Print to Dotmatrix with special forms control

Posted on 1998-09-02
6
Medium Priority
?
209 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 200 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
Technology Partners: 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses
Course of the Month8 days, 21 hours left to enroll

765 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