Commenting out almost all of the code, running it, verify all is ok, uncomment a small part run it again and see if all is still ok. Repeat this until you find to part that is causing problems is the way to go right now.

Your code looks ok. Commenting out parts of it will tell you in what part you can find the error. It seems like AddPrinterConnection is giving you trouble. The error text suggests that it cannot find the server or printer. Could this be a permissions issue?


Edited by Mart (2008-05-29 03:15 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.