Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printer bins 1

Status
Not open for further replies.

AndyGroom

Programmer
May 23, 2001
972
0
0
GB
Does anyone know; if a printer has two bins, one for A4 and one for A3, and I set the printer's paper to be A3 will the printer automatically choose the correct bin or do I also need to give the user a choice of bins?

- Andy
___________________________________________________________________
If a man speaks in a forest and there are no women around to hear him - will he still be wrong?
 
Andy - I gues you've done a google on it, it turned up these for me


Which seem to suggest it's a printer setup issue. I guess it may be feasible to carry out that setup programmatically but suspect the code required may be specific to a given printer (driver).
 
Thanks, I've coded it so the user can choose both the paper size and the bin as my gut feeling is that simply selecting the paper size won't automatically select the bin, nor can my program derive what paper size is in a particular bin if the user can only choose a bin, so I think both options are required. (If for example the printer had 2 A3 bins with different colour paper in each you'd still have to specify the bin even if you chose to print A3).

- Andy
___________________________________________________________________
If a man speaks in a forest and there are no women around to hear him - will he still be wrong?
 
Thanks Dilettante I did find that link earlier but I was hoping to just use the Printer object in VB - however I have abandoned that hope now as it only seems to allow the most basic of control over the printer.

I might be missing something with the Print Dialog box (VBPrnDlg.DLL), I don't know if you have tried it?

If you open the Dialog and go to the Preferences for your desired printer (let's assume it's the default printer) and choose a different paper size and orientation, then click Print, it does what you'd expect. However if you then want to print the same thing again and you go back into Preferences they have all reverted back to the original settings.

Do you know if there's a way to make it remember the settings you've selected?

- Andy
___________________________________________________________________
If a man speaks in a forest and there are no women around to hear him - will he still be wrong?
 
Does my code in thread222-1423165 help at all?

(I'm rather pressed for time right at the moment, so have not reviewed it, and I can't remember if it makes the settings stick or not)
 
This seems to work for me (just using PaperBin as one example):

Code:
Option Explicit

Private PrnDlg As VBPrnDlgLib.PrinterDlg
Private PaperBin As Integer 'Cache user settings, here just bin.

Private Sub Command1_Click()
    With PrnDlg
        .PaperBin = PaperBin 'Reset to cached values here.
        If .ShowPrinter(hWnd) Then
            PaperBin = .PaperBin 'Cached changed values.
            'Do the printing...
        End If
    End With
End Sub

Private Sub Form_Load()
    Set PrnDlg = New VBPrnDlgLib.PrinterDlg
    With PrnDlg
        .PrinterName = Printer.DeviceName
        .DriverName = Printer.DriverName
        .Port = Printer.Port
    End With
    PaperBin = Printer.PaperBin
End Sub
 
Andy - I use the VBPrnDlg.dll in my apps. My experience is the settings do not stick, so I save the settings made when it is used (in a UDT) to a file and restore them when it is next used. Most times the file is a temporary one which is deleted when the app closes.
 
Thanks for the link. For some reason the code sample you posted is rendered all on one line without any CRLFs which makes it a bit hard to get the gist of (I've tried pasting it into various editors but it doesn't help).

I think the Print problem might lie partially with Windows - if I go into Printer Setup via Control Panel and set my default printer to print, say, A4 Landscape, and then I go into my app and trigger the Print dialog it insists on defaulting to Letter Portrait. I don't think it's my app which is choosing these settings, in fact I've no idea where they are coming from because they aren't the defaults as set in Windows!

I can see though that a user will quickly get annoyed if they have to alter the printer preferences before every print job.

- Andy
___________________________________________________________________
If a man speaks in a forest and there are no women around to hear him - will he still be wrong?
 
My experience is the settings do not stick, so I save the settings made when it is used (in a UDT) to a file and restore them when it is next used

I must be having a senior moment, I didn't realise you could write to the printDlg object! So yes, storing the settings and restoring them next time around works perfectly thanks.

- Andy
___________________________________________________________________
If a man speaks in a forest and there are no women around to hear him - will he still be wrong?
 
AndyGroom said:
For some reason the code sample you posted is rendered all on one line without any CRLFs

That's probably a browser issue. IE8 and below have trouble with the scrollable [ignore]
Code:
 ...
[/ignore] boxes. Everything looks OK on FireFox.
 
>IE8 and below
woes can be fixed via Compatabilty settings in IE. Try the teared page icon up there next to the 'looking glass' and 'clockwise arrow' if you see one, otherwise try the Tools menu.
Does'nt seem to happen under IE9 but I'm not sure if that is a change in IE or this website.

 
It was a change on the site. Look like some historical threads didn't get patched correctly (yet) to work with the new styles.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top