markrhyman
asked on
Print Quality in VB6
Hello,
I am trying to set the print quality to the maximum before sending a print job in VB:
objPrinter.PrintQuality = vbPRPQHigh
However, I get the message:
'PrintQuality' Property is read only.
In the Default printer setting the print quality is set to 1200 which is the maximum. But when I check the printquality value in the code above this value is only to 600. That's what I want to code this value to it's maximum.
Any idea?
thanks
I am trying to set the print quality to the maximum before sending a print job in VB:
objPrinter.PrintQuality = vbPRPQHigh
However, I get the message:
'PrintQuality' Property is read only.
In the Default printer setting the print quality is set to 1200 which is the maximum. But when I check the printquality value in the code above this value is only to 600. That's what I want to code this value to it's maximum.
Any idea?
thanks
Can you please post the entire relevent code?
The method you are using is correct. But if you are facing some problem, you can use Windows API. This page (http://support.microsoft.com/kb/q190218/) lists the code necessary to get printer driver's settings. You can use the same code with some modifications to set the settings. Take a look at the Type DEVMODE. You have to set the dmPrintQuality to DMRES_HIGH = (-4).
Let me know if you need help with the code.
Let me know if you need help with the code.
ASKER
Below is some of the code I use to try to set the print quality.
Dim objPrinter As Printer
Set objPrinter = GetDefaultPrinter()
objPrinter.PrintQuality = vbPRPQHigh
Dim objPrinter As Printer
Set objPrinter = GetDefaultPrinter()
objPrinter.PrintQuality = vbPRPQHigh
Possibly you/the user under whose login your program runs, do not have permission to change printer settings. Have you checked that? If no luck, you can try Windows API method.
ASKER
I am the administrator on my computer and the domain administrator. I have checked permissions and I do have all of them when I try to change the print quality.
I will give a try to the API method that you've linked me to.
I will give a try to the API method that you've linked me to.
ASKER
Allright I had a look at the code.
How do you set that devmode printquality...
I did:
Dim pDevMode As DEVMODE
pDevMode.dmPrintQuality = DMRES_HIGH
MsgBox pDevMode.dmPrintQuality
and the msgbox says -4 which is -4
When I run the code from microsoft it still says in the listbox Printquality = 600 dpi
How do you set that devmode printquality...
I did:
Dim pDevMode As DEVMODE
pDevMode.dmPrintQuality = DMRES_HIGH
MsgBox pDevMode.dmPrintQuality
and the msgbox says -4 which is -4
When I run the code from microsoft it still says in the listbox Printquality = 600 dpi
Merely changing the property is not sufficient. You have to pass a DEVMODE structure to SetPrinter Windows API call. See this page (http://support.microsoft.com/kb/140285/EN-US/) for detailed info on the same.
ASKER
This code is in C++ I think :) I have to look for something similar in VB.
ASKER
RanjeetRain,
Did you find anything in VB? I cannot integrate the code you pointed to me.
Thanks
Did you find anything in VB? I cannot integrate the code you pointed to me.
Thanks
ASKER
Maybe the question should not be deleted. This section might be good for someone willing to put some time to convert the code that RanjeetRain pointed to (C++ to VB) or it might be useful for some C++ user.
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.