Solved

Printer.Enddoc Printer.Newpage

Posted on 2002-04-19
5
238 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month3 days, 21 hours left to enroll

630 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