|
-
February 3rd, 2000, 06:17 AM
#1
To Check If The Printer Is Connected
Hi,
When I give printer.print and if the printer is not set properly , it throws an error. Is there a way to check if the printer is ready for printing using APIs.
I tried using OpenPrinter and GetPrinter. But some where I am doing something wrong.
Please help.
Thanks
Arjun
Software Engineer
Bangalore
-
February 3rd, 2000, 06:45 AM
#2
Re: To Check If The Printer Is Connected
Arjun.
You could simply put the following in a function
public function Checkprinter() as boolean
on error GoTo Printererr:
Dim printername as string
printername = Printer.DeviceName
CheckPrinter=true
Exit function
Printererr:
If Err.Number = 484 then
'Printer Not Installed Correctly
CheckPrinter=false
else
MsgBox Err.Number & " " & Err.Description
End If
end function
Hope This Helps
-
February 3rd, 2000, 10:52 PM
#3
Re: To Check If The Printer Is Connected
Hi,
The problem with the solution suggested is that
1. If the printer is connected on a network computer (ie when trying to print form your system by connecting to a different computer's printer) this will throw an error, while if we give a print in word, the document is printed properly
2. Delete an existing printer and then when I try this(without reebooting the system), it is retreving the printer name and doesn't throw an error. But when you give a prin command now from word, word shows a printer error.
Thanks
Arjun
Software Engineer
Bangalore
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
|