How to verify printer status in Lpt1

How to verify if printer is turn on or turn off in port lpt1.
The code to print is:

open "lpt1" for output as #1
print "....."
close #1

sartoriusAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mark2150Commented:
This is NOT how to do printer I/O in VB!

You should print to the logical PRINTER device and let windows do the direct management of the printer. If you use your method you'll be unable to print to network or other shared printers. Additionally you run the possibility of interfering with a "normal" windows job.

M
0
damienmCommented:
Dim x As Printer

'select a printer
For Each x In Printers
    If UCase(x.DeviceName) = "PRINTERNAME" Then
        Set Printer = x
    End If    
Next x
0
VBGuruCommented:
There are two ways you can do this. Depending on your convenience you do.

1. VB doesn't allow you to check the printer port status diectly so you can use some of the ocxs available in the maraket to check the status of the port and know the status. Some of the links you can check out:
http://www.vbonline.com/vb-mag/9910/item/showcase.htm 
http://www.advantech.com.tw/products/automation_software/intouch-driver.htm

2. Windows provides some of the API calls using which you can know the status of the printer. Some of the APIs are GetPrinter which can return the information about the printer in any of a PRINTER_INFO_1, PRINTER_INFO_2, PRINTER_INFO_3, PRINTER_INFO_4, or PRINTER_INFO_5 structures.
As I don't have specific examples using thase API calls I can't help you with the example
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.