Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Local & Network & Share Name Printers
Message
From
28/10/2004 09:26:16
 
 
To
28/10/2004 09:14:39
Carl Dobson
Reference Point Computers
Overbury, Tewks, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP
Miscellaneous
Thread ID:
00955218
Message ID:
00955253
Views:
26
Hi Carl,

Sorry, no answer... just put formatting on for the code snippet. Go into reply and look immediately before first code line and immediately after last to see how you can do so next time.

cheers
>Ok have just found the semi-solution to this - I can now seperate the Network from the Local Printers and display them accordingly. HOWEVER I still need to find the Share names of these Printers.
>This is my code on how I got the printers & displayed them:
>LOCAL lcpamount, lcprntname, ncount, lcprn
>lcprntname = ""
>lcPart1 = ""
>lcPart2 = ""
>lcNetwork = ""
>lcLocal = ""
>lcnetc = ""
>lclocalc = ""
>nline = 1
>
>APRINTERS(aprnt) &&& Get list of Printers
>lcpamount = ALEN(aprnt) &&& Find how many items in Array
>
>FOR ncount = 1 TO lcpamount
>	lcprn = ALLTRIM(aprnt(ncount))
>	IF nline = 1
>		lcPart1 = ALLTRIM(lcprntname) +" " +ALLTRIM(lcprn)
>		nline = 2 &&& The next information will be Part 2 of the String
>	ELSE
>		IF LEFT(lcprn,1) = "\"
>		lcNetwork = lcPart1 + " Attached to " + lcprn +CHR(13) +CHR(10)
>			&&& Create a line feed & Carrage return
>			lcNetc = lcNetc + lcNetwork
>			&&& String for the Network information
>		ELSE
>		lcLocal = lcPart1 + " Attached to Port " + lcprn +CHR(13) +CHR(10)
>			&&& Create a line feed & Carrage return
>			lcLocalc = lcLocalc + lcLocal
>			&&& String for the Local information
>		ENDIF
>		nline = 1 &&& Go back to get part one of the string
>	ENDIF
>ENDFOR
>
>THISFORM.pageframe1.page2.edtPDIR.VALUE=ALLTRIM(lcLocalc) && Populate all Local Printers
>THISFORM.pageframe1.page2.edtPNET.VALUE=ALLTRIM(lcNetc) && Populate all Network Printers
>
>If anyone could help with finding the sharenames of the printers it would help allot.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform