Click here to Skip to main content
16,004,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Greetings,

I wonder if someone can help me with the following:

I have a list of printers installed in my pc, some are physical & some are virtual (eg. SnagIT 9, & Nitro PDF Creator).

i) Is there a way to check if the default printer is virtual or physical through a VB6.0 code?

ii) How I can find a physical printer installed in my pc set it as default from a VB6.0 code?

The idea behind this is to let the application written in VB6.0 code to change the 'PaperSize' and 'Orientation' properties of the default printer as the report needs at runtime.

Any try to help will be appreciated a lot.
Thanks in advance.
Posted
Updated 21-Dec-10 2:37am
v2
Comments
Henry Minute 21-Dec-10 9:59am    
Do you mean 'find the first physical printer' or 'find a specific physical printer'?

To find out if a printer is physical you can read the WMI Win32_Printer.

This link has code to do that in vb6:
http://www.vbforums.com/showthread.php?p=3870232[^]

Reference of Win32_Printer:
http://msdn.microsoft.com/en-us/library/aa394363%28v=vs.85%29.aspx[^]

The following data members can give you info on what kind of printer you're dealing with:
- DeviceID
- Local
- Location
- MarkingTechnology
- Network
- PNPDeviceID

Good luck!
 
Share this answer
 
Thanks a lot my friend...

But I think this has nothing to do with my case...

what I need is to check if the default printer is physical or virtual, and if it is a virtual one, then how I could set an existing physical printer as the default one through vb6.0?

There should be an interface, class, property, method, or something that will return the type of a specified printer so that I can use to implement my client request.

If you get my idea, and have something that could help me, I will be very appreciated...

Thanks in advance....
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900