Solved

Printer.Enddoc Printer.Newpage

Posted on 2002-04-19
5
209 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
No problem.  Glad it works for you!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…
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…

772 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

10 Experts available now in Live!

Get 1:1 Help Now