Printing using printer properties
Is there any way to print to a printer in VB6 using all the capabilities of the printer drivers.
Most printers have a vast array of options, eg double sided, booklet form or even things like stapled if you can print to the office photocopier.
Proprietry programs like Word, Excel etc automatically pick up these features when you print, using the properties button in the printer dialog.
I can use the common dialog supplied with VB6 or the replacement from MDSN or call it via API calls but I can never get my program to print according to all the preferences set, when using standard Printer.Print commands etc.
I would prefer not to change the default printer as this can have unwanted side effects on other programs if my application is still running.
Is there any way of acomplishing this, theoretically, standard function in VB6? If all the other programs can do this why can't VB6? I'm even willing to try printing via API if someone can point me in the right direction.
Re: Printing using printer properties
You can use the Vbprndlg.dll file instead of the Print dialog box portion of the Visual Basic CommonDialog control. This file exposes properties and provides functionality that the CommonDialog control does not.
Information is found here:
http://support.microsoft.com/kb/322710
Tom
Re: Printing using printer properties
Quote:
Originally Posted by
Tom Moran
You can use the Vbprndlg.dll file instead of the Print dialog box portion of the Visual Basic CommonDialog control. This file exposes properties and provides functionality that the CommonDialog control does not.
Yes I've tried that one. You still have no access to most of the print driver's properties.
I suppose it is VB's Printer object that is limiting the options.
Re: Printing using printer properties
are you wanting to set the printer properties for the vb printer object or present a dialog for the user to select from?
just about all print options are available to vb printer object, though later operating systems seem to have broken some previously working features
which specific properties are you having problems setting?
Re: Printing using printer properties
Quote:
Originally Posted by
westconn1
are you wanting to set the printer properties for the vb printer object or present a dialog for the user to select from?
I was hoping to print using the printer object. I want the user to be able to select the desired printer and any properties as one does from any word processor for instance. I have effectively written my own very simplified report writer, so I'm just setting the font size and X Y position and using Print statements.
Quote:
Originally Posted by
westconn1
which specific properties are you having problems setting?
Really I want the user to be able to use all properties available, but especially things like the number of pages per sheet, and booklet printing and saddle-stich stapling which the main office printer can cope with.
I was wondering about outputting to a Word object if that is possible (although I've never tried that), but the formatting would then be more complicated, and then possibly letting Word do the printing if that is possible, but presumably this would cause problems if the user does not have Word installed.
Re: Printing using printer properties
It would definately cause problems if the user did not have Word installed (in fact, it just flat out would not work), but, using something like Word or Excel would be the easiest way to accomplisy your goal.
The printer object in VB can be powerful, but it can also be limiting.
Quote:
Originally Posted by PJB146
Really I want the user to be able to use all properties available....booklet printing and saddle-stich stapling
I don't even know what that is, but I feal reasonably comfortable in saying you aren't gonna get that out of Printer.Print
Re: Printing using printer properties
Just a thought, PJB... Since most printers include a software interface for setting it's myriad of options, could you not just shell that interface from your program?