Solved

Printer.Enddoc Printer.Newpage

Posted on 2002-04-19
5
227 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
[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
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

710 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