Unable to catch print exceptions
-
Hello All, I am new to .NET. Can any body please tell me how to catch all possible error that PrintDocument.Print() method returns!!! I have installed a dummy printer on my machine..and tried to give print using PrintDocument.Print() method, but it is not giving any error. When i tried with an older application(which is written in C,C++)..it is throwing an error saying Network printer error. How can i catch same error using VB.NET 2005. Thanks in advance. Regards, Sr
-
Hello All, I am new to .NET. Can any body please tell me how to catch all possible error that PrintDocument.Print() method returns!!! I have installed a dummy printer on my machine..and tried to give print using PrintDocument.Print() method, but it is not giving any error. When i tried with an older application(which is written in C,C++)..it is throwing an error saying Network printer error. How can i catch same error using VB.NET 2005. Thanks in advance. Regards, Sr
-
Just put a try/catch round your code, that will capture all exceptions.
Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP
Bob, No luck with Try/Catch. With PrintDoc.Print() it is adding document in queue. where as my old system not adding doc to printer and is shoing error like network error. Really i want solution for this..if printer does not return any vaklue then my code goes wrong.Please assist me. Regards, Sr
-
Bob, No luck with Try/Catch. With PrintDoc.Print() it is adding document in queue. where as my old system not adding doc to printer and is shoing error like network error. Really i want solution for this..if printer does not return any vaklue then my code goes wrong.Please assist me. Regards, Sr
sri_0099 wrote:
With PrintDoc.Print() it is adding document in queue
And is the document correct? If so, maybe you need to be checking the printer status or something? Its years since I used printdoc, so I can't remember all the commands, but there should be something to check the printer status I would expect.
Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP