Solved

Printer.Enddoc Printer.Newpage

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

832 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