|
-
Apr 11th, 2001, 01:18 AM
#1
I need to find out if a printer is currently accessible on a network.
I tried the following code but all printers showed "Not Available" even though two were (local)
MSDN uses a printer name like "\\server\print1"
in its "example".
What am I doing wrong?
For Each Pr In Printers
Dim wshNet As Object
Set wshNet = CreateObject("Wscript.Network")
On Error Resume Next
wshNet.AddPrinterConnection "LPT1:", Pr.DeviceName
If Err Then
MsgBox "The printer " & Pr.DeviceName & " is not available"
Else
MsgBox "The printer " & Pr.DeviceName & " is available for printing"
End If
Set wshNet = Nothing
Next
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|