The following code can be put onto button "Command1".<br>
It prints two lines, the first line ends with ";" and therefore does not cause CRLF on the printer.<br>
<br>
<br>
Private Sub Command1_Click()<br>
Printer.Print " this is a line of text";<br>
Printer.Print " this continues the line."<br>
Printer.EndDoc<br>
<br>
End Sub<br>
<br>
Hope this is what you want
Hi,<br>
<br>
Can I just say that we use the printer object for small type reports and its extremely fast. You can do a good bit with it.<br>
<br>
I recommend all programmers to investigate it, as jo0hncb shows, its very easy to use.<br>
<br>
C
I want to print a single line from a running program without the program sending a form feed. <br>
1 The program receives a serial string <br>
2 The programs filters the string <br>
3 The program prints out the string on one line <br>
4 the program waits for the next string <br>
5 the program prints the string on the next line <br>
After the program filters the string, put the following line before EXIT SUB:<br>
<br>
Printer.Print STRING<br>
<br>
It will advance to the next line when it is read again.<br>
<br>
Be Aware, this will tie up the printer until the program ends.
Try this to achieve what I think that you are trying to do:<br>
(I am going to assume that you are printing to the printer device)<br>
<br>
.<br>
.<br>
.<br>
Printer.Print Chr(13); Chr(10); "This is your line of text";<br>
.<br>
.<br>
.<br>
<br>
This will be in a loop somewhere, waiting for a string and when it gets one it will execute the print line above. What that line does is to create a new line and then print on it, leaving the latest line printed as the bottom line.<br>
<br>
HTH,<br>
<br>
John<br>
THERE ARE TWO WAYS TO PRINT LINE BY LINE
1)USE OPEN STATEMENT
Open "LPT1:" For Output As #1
Print #1, Tab(4);TEXT1; Tab(19); TEXT2; Tab(33); TEXT3'FIRST LINE
Print #1, Tab(4);TEXT1; Tab(19)'SECOND LINE
.....AND SO ON
Close #1
2) USE OPEN STATEMENT TO MAKE A FILE
Open "C:\TEST\PR.TXT" For Output As #1
PRINT ...... THE SAME ABOVE
CLOSE #1
BEFORE THAT MAKE A BAT FILE FOR EXAMPLE C:\TEST\PR.BAT WITH THE PHRASE:
COPY C:\TEST\PR.TXT PRN
THEN FROM VB PROJECT:
CALL SHELL("C:\TEST\PR.BAT ",vbHide )
I HAVE TESTED BOTH OF THEM AND WORK PERFECT
USING THE FIRST WAY FROM AN ACCESS 97 MDB PRINT ABOUT 600
LINES EVERY DAY FOR 6 YEARS WITH NO PROBLEM
HOPE TO HELP YOU
GNIKOL
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.