?
Solved

in VB6 picking the the output bin on a laserprinter

Posted on 2009-04-06
12
Medium Priority
?
413 Views
Last Modified: 2012-06-27
I have 2 different output bins to collect my paperoutput
How to call in VB6 either output bin 1 or output bin  2
0
Comment
Question by:BIAPRO
[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
  • 6
  • 6
12 Comments
 
LVL 18

Expert Comment

by:David Robitaille
ID: 24080439
ther is a Printer.PaperBin  property that you could set.
check the link for a list of the PrinterObjectConstants that you could use to set it.
http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.powerpacks.printing.compatibility.vb6.printer.paperbin.aspx
0
 

Author Comment

by:BIAPRO
ID: 24085247
do i have do install something from microsoft?  just like that i cant run it
0
 
LVL 18

Expert Comment

by:David Robitaille
ID: 24086660
no, you should not have to install something for microsoft.
how are you printing? do you use vb.printer ?
this work ok with me.
VB.Printer.PaperBin = vbPRBNUpper
 
here a article series about printing with VB using printers objects, do you print using something else?
http://www.devx.com/getHelpOn/10MinuteSolution/18219/0/page/1 
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:BIAPRO
ID: 24086939
This will set my input bin form wich tray to get the paper, what i do need is how to set the output bin (receiver of printed paper)
0
 
LVL 18

Expert Comment

by:David Robitaille
ID: 24087060
ho i see,
you could try using "VBPrnDlg.dll"
http://support.microsoft.com/kb/322710
It offer extended possibility. if you dont need to set the output bin form the code it should be a solution.
If you do need to set the output bin form the code, I`m not sure it will help...
 
0
 

Author Comment

by:BIAPRO
ID: 24087173
in old day's of qbasic i did this
lprint chr$(27) + "&l" +  "1G"               '1 for lowerbin 2 for upperbin
plain simple
0
 
LVL 18

Expert Comment

by:David Robitaille
ID: 24087235
it`s becaus you are sending the "command" directly to the printer, it`s something printer driver specific....
anyway, did you try ?
VB.Printer.Print  chr$(27) & "&l" &  "1G"
   
0
 

Author Comment

by:BIAPRO
ID: 24087389
Wil try , but not in the neiberhood off this printer now, keep you informed, thanks
0
 
LVL 18

Accepted Solution

by:
David Robitaille earned 2000 total points
ID: 24087517
i made a quick search for you. It look like your printer is a HP printer.
http://beechglen.com/pcl/hppcl.html
Anyway, if VB.Printer.Print does not work, you will have to find a way to write directly on the printer. Here a link, this guy is trying to migrate code form vb6 to vb.net. he commented out some of his old code.
http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/facd6440-b4b6-4f5d-ae0c-689fb0ce4c15/
it look like he putting the binary data he want to print into a file and then using cmd.exe to copy the file directly on the print server (i guess Dcpp100 is a print server).
"cmd.exe /C Copy /b """ & FName & """ \\Dcpp100\" & sPrinter
 
 (/b is binary mode)
I hope that will help
0
 

Author Comment

by:BIAPRO
ID: 24094243
looks pretty logical will play with this, thanks
0
 
LVL 18

Expert Comment

by:David Robitaille
ID: 24095893
using copy is only one possibility.
you may also try to do it using the open #fileNumber and Print/ or Write#.
if you are able to open the printer for writing as a file, you may be able to write on it as a file...
 
 
0
 

Author Comment

by:BIAPRO
ID: 24096066
will try, thanks
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

741 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