Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

send escape sequences to the printer from windows95

Posted on 1999-07-28
1
Medium Priority
?
238 Views
Last Modified: 2010-04-30
I have a simm loaded with forms that i insert in the memory banks
of an hp 4 plus printer, To print this forms  from ms-dos and windows 3.x a send escape sequences (hp pcl commands)using the chr(27)(escape character) from a program that i made in visual basic.
My problem is that when i try to do the same operation from windows 95 using visual basic 5.0 i can't. same people tell me that windows 95 don't recognize the chr(27), i try the passtrogh
but don't work.
If you can help, please send me and email
0
Comment
Question by:pelon
[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
1 Comment
 
LVL 3

Accepted Solution

by:
kfrick earned 150 total points
ID: 1527914
I have found that you can write the entire printer output to a file, then use the SHELL command to fire the DOS "PRINT" command.....

      Sub TestPrint()
        Open "C:\Test.txt" for Output As #1
        Print #1, "This is plain Text"
        Print #1, Chr$(27);Chr$(whatever is Bold);"This is Bold Text"
        Close #1
        Shell "PRINT C:\TEST.TXT"
      End Sub

Remember that the Print# statement automatically adds a  Carriage Return Chr$(13) to the line. You may also have to add a Line Feed Chr$(10), depending on your printer. You can also suppres the automatic CR by ending the statement with a semi-colon, like so....
        Print #1, "This is the first line....";
        Print #1, "And so is this!"
This feature can be usefull to mix print styles on the same line....

Hope this helps!
-kf
0

Featured Post

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!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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

715 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