Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What printers have been defined
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00529119
Message ID:
00529310
Views:
11
You can use following script to store the list of avaialable printers into text file and than parse it in FPW26. Be advised that you have to have WSH installed in order to use it.
Set oNetwork = CreateObject("WScript.Network")
Set oPrinters = oNetwork.EnumPrinterConnections
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oTextStream = oFSO.CreateTextFile("h:\temp\prntlist.txt")

For i = 0 to oPrinters.Count - 1 Step 2
	lcStr = "Port " + oPrinters.Item(i) + " = " + oPrinters.Item(i+1)
	oTextStream.WriteLine(lcStr)
Next
oTextStream.Close
>Under W95 you can determine what printers have been defined by looking into the win.ini. This, however, does not work for WNT because this data is not stored in this file.
>
>Unlike VFP where you can use the aprinters() function to determine what printers are available this function does not exist in FPW26.
>
>Is there a way to determine the available printers the same way VFP does in FPW26? Is there a (custom) function to determine what printers are available that I can use in FPW26.
>
>Any help is appreciated.
>
>Regards,
>
>Ron Brahma
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform