[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 767
  • Last Modified:

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
0
markrhyman
Asked:
markrhyman
  • 6
  • 4
1 Solution
 
RanjeetRainCommented:
Can you please post the entire relevent code?
0
 
RanjeetRainCommented:
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.
0
 
markrhymanAuthor Commented:
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
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
RanjeetRainCommented:
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.
0
 
markrhymanAuthor Commented:
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.  
0
 
markrhymanAuthor Commented:
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

0
 
RanjeetRainCommented:
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.
0
 
markrhymanAuthor Commented:
This code is in C++ I think :) I have to look for something similar in VB.
0
 
markrhymanAuthor Commented:
RanjeetRain,

Did you find anything in VB?  I cannot integrate the code you pointed to me.  

Thanks
0
 
markrhymanAuthor Commented:
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
0
 
ee_ai_constructCommented:
Question answered by asker or dialog deemed valuable.
Closed, 125 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now