Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GETPRINTER() TRAGEDY

Status
Not open for further replies.

castor2003

Programmer
Jul 5, 2003
115
0
0
LC
I was utterly humiliated by the failure of this function to pop the dialog box for the user to select a printer. Instead it returned a 'Printer Not Ready'. The tragedy is that the program won't get continued if a printer is not selected. What I found is that when the default windows printer is not accessible, GETPRINTER() returns a 'Printer Not Ready message. Any idea around this disaster would be greatly appreciated.


 
castor2003

Getprinter() returns a list of "installed printer drivers" on the computer, not "plugged in printers". What are trying to get?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Installed printers.

If the default printer is not accessible, forinstance if it is a network printer and the network is not available, it returns an error "Printer Not Ready" - does not show the dialog box
 
castor2003

I'll repeat, Getprinter() gives you a list of installed printer drivers, not printers that are actually plugged into to network, if it throws an error then trap the error and show the user your message.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike,

This is exactly what I a saying to you. I am about three different printer drivers installed on my machine. Two are network printers. If I set one of the Network Printers as my default printer and proceeds to breaking my network connection and run GETPRINTER(), I get the error message without the expected dialog box. However, if I make the accessible printer the machine's default printer; only then will I get the dialog box which includes all the installed printer drivers.

Hope I am clear this time.
 
You could try using APRINTERS() to display the list of printers instead of GETPRINTER(). APRINTERS() returns a two-dimensional array of installed printers, but it also does not indicate whether the printers are actually connected. However, it doesn't depend on the default printer being online, so that might be a solution for you.


Mike Krausnick
Dublin, California
 
mkrausnick

I guess I would have to go your way thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top