Solved

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

Posted on 2006-07-21
4
355 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: 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!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

695 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