Click here to Skip to main content
12,887,768 members (32,804 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB6

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 21-Dec-10 2:18am
Updated 21-Dec-10 2:37am
Henry Minute 21-Dec-10 9:59am
Do you mean 'find the first physical printer' or 'find a specific physical printer'?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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

This link has code to do that in vb6:[^]

Reference of Win32_Printer:[^]

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!
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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....

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170424.1 | Last Updated 21 Dec 2010
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100