How to print a single line without formfeed 
Author Message
 How to print a single line without formfeed

How can I print from Visual Basic, one line at a time
without a formfeed.
I am using the Printer Object and the Print method, but
wenn I send the printer EndDoc method, my line is printed
folowed with a new page.
I need to print the line.  Later, print another line again,
and agin.... without formfeed.
I' am working with a printer capable of printing a single
line that means, there is not a Laser printer or printer
that must print a page at at time.

Best Tanks

G. Brodbek

* Sent from AltaVista http://www.*-*-*.com/ Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful



Wed, 18 Jun 1902 08:00:00 GMT  
 How to print a single line without formfeed
It is unclear what your goal is.  But if  you just want to wait and
control when the document is printed, just don't send it the endDoc
until your ready.  However if you want to save the line after
you end the application, I don't think you can do that.

Or if you really want to print a line at a time you might want to do
a dos call.  I tested this and as stupid as it looks it actually works
even on a printer that has a windows driver like an Epson 700.

Create a small batch program that prints a file, I called it
printline.bat  

copy c:\windows\printline.txt lpt1:

For my example I created a form with one command button that
calls the sub print line.

Private Sub Command1_Click()
    PrintLine ("Hello")
End Sub

Public Sub PrintLine(PrintString As String)
Dim printfile As Integer, retval As Long
  printfile = FreeFile
  Open "c:\windows\printline.txt" For Output As #printfile
     Print #printfile, PrintString
  Close
  retval = Shell("C:\windows\PrintLine.bat", 0)
End Sub

So the command button passes the text to the procedure that writes out
a string and the  and calls a Dos program that prints the file.  I
tested it, if nothing else works this will do in a pinch.

On Tue, 11 Apr 2000 01:12:01 -0700, G.Brodbek

Quote:

>How can I print from Visual Basic, one line at a time
>without a formfeed.
>I am using the Printer Object and the Print method, but
>wenn I send the printer EndDoc method, my line is printed
>folowed with a new page.
>I need to print the line.  Later, print another line again,
>and agin.... without formfeed.
>I' am working with a printer capable of printing a single
>line that means, there is not a Laser printer or printer
>that must print a page at at time.

>Best Tanks

>G. Brodbek

>* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful



Wed, 18 Jun 1902 08:00:00 GMT  
 How to print a single line without formfeed
I think it's even simpler than that.  In VB3, I can just put:

Open "lpt1" for output as #1
Print#1, "Hello World"
Close #1

Qbasic programmers - note the lack of a colon after lpt1

Can someone try it on VB6?  Or does nobody have dot matrix printers any
more?

This also works for com1 etc for simple comms stuff on VB3.
---------------



Quote:
>It is unclear what your goal is.  But if  you just want to wait and
>control when the document is printed, just don't send it the endDoc
>until your ready.  However if you want to save the line after
>you end the application, I don't think you can do that.

>Or if you really want to print a line at a time you might want to do
>a dos call.  I tested this and as stupid as it looks it actually works
>even on a printer that has a windows driver like an Epson 700.

>Create a small batch program that prints a file, I called it
>printline.bat

>copy c:\windows\printline.txt lpt1:

>For my example I created a form with one command button that
>calls the sub print line.

>Private Sub Command1_Click()
>    PrintLine ("Hello")
>End Sub

>Public Sub PrintLine(PrintString As String)
>Dim printfile As Integer, retval As Long
>  printfile = FreeFile
>  Open "c:\windows\printline.txt" For Output As #printfile
>     Print #printfile, PrintString
>  Close
>  retval = Shell("C:\windows\PrintLine.bat", 0)
>End Sub

>So the command button passes the text to the procedure that writes out
>a string and the  and calls a Dos program that prints the file.  I
>tested it, if nothing else works this will do in a pinch.

>On Tue, 11 Apr 2000 01:12:01 -0700, G.Brodbek

>>How can I print from Visual Basic, one line at a time
>>without a formfeed.
>>I am using the Printer Object and the Print method, but
>>wenn I send the printer EndDoc method, my line is printed
>>folowed with a new page.
>>I need to print the line.  Later, print another line again,
>>and agin.... without formfeed.
>>I' am working with a printer capable of printing a single
>>line that means, there is not a Laser printer or printer
>>that must print a page at at time.

>>Best Tanks

>>G. Brodbek

>>* Sent from AltaVista http://www.altavista.com Where you can also find

related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is
Beautiful

- Show quoted text -



Wed, 18 Jun 1902 08:00:00 GMT  
 How to print a single line without formfeed
Yes it does peter.  I couldn't remember the exact syntax.  I know
a lot of those Qbasic commands still work,   they are just not
documented.



Quote:
>I think it's even simpler than that.  In VB3, I can just put:

>Open "lpt1" for output as #1
>Print#1, "Hello World"
>Close #1

>Qbasic programmers - note the lack of a colon after lpt1

>Can someone try it on VB6?  Or does nobody have dot matrix printers any
>more?

>This also works for com1 etc for simple comms stuff on VB3.
>---------------



>>It is unclear what your goal is.  But if  you just want to wait and
>>control when the document is printed, just don't send it the endDoc
>>until your ready.  However if you want to save the line after
>>you end the application, I don't think you can do that.

>>Or if you really want to print a line at a time you might want to do
>>a dos call.  I tested this and as stupid as it looks it actually works
>>even on a printer that has a windows driver like an Epson 700.

>>Create a small batch program that prints a file, I called it
>>printline.bat

>>copy c:\windows\printline.txt lpt1:

>>For my example I created a form with one command button that
>>calls the sub print line.

>>Private Sub Command1_Click()
>>    PrintLine ("Hello")
>>End Sub

>>Public Sub PrintLine(PrintString As String)
>>Dim printfile As Integer, retval As Long
>>  printfile = FreeFile
>>  Open "c:\windows\printline.txt" For Output As #printfile
>>     Print #printfile, PrintString
>>  Close
>>  retval = Shell("C:\windows\PrintLine.bat", 0)
>>End Sub

>>So the command button passes the text to the procedure that writes out
>>a string and the  and calls a Dos program that prints the file.  I
>>tested it, if nothing else works this will do in a pinch.

>>On Tue, 11 Apr 2000 01:12:01 -0700, G.Brodbek

>>>How can I print from Visual Basic, one line at a time
>>>without a formfeed.
>>>I am using the Printer Object and the Print method, but
>>>wenn I send the printer EndDoc method, my line is printed
>>>folowed with a new page.
>>>I need to print the line.  Later, print another line again,
>>>and agin.... without formfeed.
>>>I' am working with a printer capable of printing a single
>>>line that means, there is not a Laser printer or printer
>>>that must print a page at at time.

>>>Best Tanks

>>>G. Brodbek

>>>* Sent from AltaVista http://www.altavista.com Where you can also find
>related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is
>Beautiful



Wed, 18 Jun 1902 08:00:00 GMT  
 How to print a single line without formfeed


Wed, 18 Jun 1902 08:00:00 GMT  
 How to print a single line without formfeed
Hi-

I just started with vb6, so my problem is in all likelyhood very trivial.

I am trying to create an image with 256 shades of e.g. blue. I use the line
methods to create filled boxes , and I call the RGB function for the color
definition (RGB(0,0,intens). I have checked if the 'intens' parameter
actually spans the 256 range, and it does. The resulting image paints the
image but only with a 3 color apparently halftone quality.

So if any of you out there have any help it will be much appreciated.

Steffen

My Radioastronomy Site
http://www.protein.auc.dk/~i5sp/radioastronomy/AARAO.html



Wed, 18 Jun 1902 08:00:00 GMT  
 How to print a single line without formfeed
Have you checked your computer's color setting?
click on Start, Settings, Control Panel, Display, Settings and set to High
Color ot True Color.
Anne Scott


Quote:
> Hi-

> I just started with vb6, so my problem is in all likelyhood very trivial.

> I am trying to create an image with 256 shades of e.g. blue. I use the
line
> methods to create filled boxes , and I call the RGB function for the color
> definition (RGB(0,0,intens). I have checked if the 'intens' parameter
> actually spans the 256 range, and it does. The resulting image paints the
> image but only with a 3 color apparently halftone quality.

> So if any of you out there have any help it will be much appreciated.

> Steffen

> My Radioastronomy Site
> http://www.protein.auc.dk/~i5sp/radioastronomy/AARAO.html



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Printing without Formfeed

2. Can I print in VB4 without formfeed?

3. Printing single lines

4. Printing single lines

5. HELP needed - printing only single lines not pages

6. textbox enabling: single line printing

7. print line without carriage return

8. Dim multiple lines or single line

9. Printing Two RTF controls in a single print session

10. Printing multiple reports as a single print job (or email)

11. Change settings for printer from single sided printing to double sided printing and vice versa

12. Can I print without a formfeed at end of document?

 

 
Powered by phpBB® Forum Software