Solved

Where in a system, does vb get the list of installed printers

Posted on 2006-07-21
4
351 Views
Last Modified: 2010-05-18
Hi

I'm working on an application which needs to obtain the list of printers installed on the machine. I am working with my software and an external software program. I need to know where this external program gets it's list of printers from, does anyone know where in the system software usually gets this info from and are there several different registery locations

Any ideas appreciated.
0
Comment
Question by:eneate
  • 2
4 Comments
 
LVL 43

Assisted Solution

by:TimCottee
TimCottee earned 125 total points
ID: 17153164
Hi eneate,

VB has a Printers collection which enumerates all the available printers installed on a machine. This uses an API call internally to generate the list. All applications should use the same API call, either natively or wrapped into a collection as vb does. After all, that is what it is there for.

Tim Cottee
0
 

Author Comment

by:eneate
ID: 17153207
Hi Tim

Thanks for that the problem is that in the one app it is sometimes listing the printers with capital letters and others without, and this seams to effect how the software then sees the call and sometimes a printer is output to and other times not. Any idea why this would be? I was wondering if there were diffferent registry files which the software might call the list of printers from.

eneate
0
 
LVL 4

Accepted Solution

by:
JRCSystems earned 125 total points
ID: 17159628

Key for all local printers:
HKEY_LOCAL_Machine\System\CurrentControlSet\Control\Print\Printers

Network Printer(s) and User-modes of local printers:
HKEY_CURRENT_USER\Printers\Connections
and
HKEY_CURRENT_USER\Printers\DevModes2

I would point out, if the original problem, has only to do with uppercase, vs lowercase....

Why not use either $UCASE() or LCASE$() on both arguments in the comparision to force them to the same case?
That would seem easier than digging through the registry.
0
 

Author Comment

by:eneate
ID: 17160398
yo  thanks for that, it all seams to do the trick.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question