>I use aprinters() to get all the printers on a user's machine. Weird thing is that when I want to pick a given printer sometimes it does'nt appear in the list of available printers.
>
>And if I come back to it either after closing the application or even trying again later (without closing the app) it works allright.
>
>One system is alone and another one is part of a network.
>
>Any explanation for this behaviour?
>
>Would you recommend something other than aprinter() to get the printers?
One way
CLEAR
strComputer = "."
objWMIService = Getobject("winmgmts:"+ "{impersonationLevel=impersonate}!\\" + strComputer + "\root\cimv2")
colInstalledPrinters = objWMIService.ExecQuery("SELECT * FROM Win32_Printer")
For Each objPrinter In colInstalledPrinters
?"Name: " + objPrinter.Name
Next
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst