Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
APRINTERS() doesn't seem to work right
Message
 
To
20/04/2007 11:33:36
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 7 SP1
Miscellaneous
Thread ID:
01218322
Message ID:
01218343
Views:
41
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform