Solved

Printer.Enddoc Printer.Newpage

Posted on 2002-04-19
5
213 Views
Last Modified: 2006-11-17
I am writing a small program, which makes a simple calculation.  After doing it, the total has to be printed in a small sheet of paper.  Up to this everything is okay.  But, just for 3-4 lines, a full sheet has to be wasted when we use the printer.print and printer.enddoc.

So, is there any way around to make a printer stop after printing a few lines, and then starting the next print job from there itself, instead of from the next page?

S Krupa Shankar
0
Comment
Question by:shankarkrupa
  • 2
  • 2
5 Comments
 
LVL 22

Accepted Solution

by:
rspahitz earned 100 total points
ID: 6954415
The answer is to change the printer page settings.  By changing the paper size, it will eject to that level.

Alternately, you can try writing directly to the printer (bypassing the Windows spooler), but that will only work with dot-matrix or line printers and only if they don't buffer the data beyond one line.

Open "LPT1:" for output as #1
print #1, "first line"
print #1, "second line"
close #1

(This assumes that the printer is attached to parallel port #1.)
0
 
LVL 4

Expert Comment

by:frankd
ID: 6954473
Just take out the printer.enddoc.  You can then keep track of how many 3-4 lines have been queued, when a full page is queued use the printer.enddoc and then start over.
0
 
LVL 3

Author Comment

by:shankarkrupa
ID: 6958055
frankd

Your suggestion means that I must know how many lines I am going to print and more importantly, I cannot print when I have only 3-4 lines.

But, it is neccessary that I print a small piece of paper and end that there itself.

rspahitz
I do not have access to the printer at this moment.  I will check it tomorrow and will definitely tell  tomorrow night here.

Thanks
0
 
LVL 3

Author Comment

by:shankarkrupa
ID: 6962148
Thanks rspahitz, I tested it yesterday itself, and it works great-Just what is wanted.  Thank you.  Sorry I could not accept this as answer yesterday itself, for I did not have internet access yesterday.  Thank you.
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6963255
No problem.  Glad it works for you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

932 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now