|
-
Jul 24th, 2011, 09:28 AM
#1
Thread Starter
New Member
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.
-
Jul 24th, 2011, 11:35 AM
#2
Addicted Member
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
-
Jul 24th, 2011, 05:10 PM
#3
Thread Starter
New Member
Re: Printing using printer properties
 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.
-
Jul 25th, 2011, 05:11 AM
#4
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?
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Jul 25th, 2011, 06:20 AM
#5
Thread Starter
New Member
Re: Printing using printer properties
 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.
 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.
-
Jul 25th, 2011, 06:48 AM
#6
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.
 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
-
Jul 25th, 2011, 09:51 AM
#7
Addicted Member
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|