Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB6
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 21-Dec-10 3:18am
DND146
Edited 21-Dec-10 3:37am
v2
Comments
Henry Minute at 21-Dec-10 9:59am
   
Do you mean 'find the first physical printer' or 'find a specific physical printer'?
Rate this: bad
good
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:
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!
  Permalink  
Rate this: bad
good
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....
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 390
1 OriginalGriff 205
2 Zoltán Zörgő 124
3 Dave Kreskowiak 120
4 BillWoodruff 110
0 OriginalGriff 7,610
1 DamithSL 5,559
2 Sergey Alexandrovich Kryukov 5,324
3 Maciej Los 4,961
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 21 Dec 2010
Copyright © CodeProject, 1999-2014
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