Solved

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

Posted on 2006-07-21
4
348 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now