Saved printer setup string causes crash with newer printers

In my app, I save the printer setupstring and then restore it the next time the app runs, so the user doesn’t have to set up the printer and margins all the time (and the app can print to multiple printers - think pick tickets printed to multiple warehouse locations). This has worked great until recently, when the user installed an HP Laserjet 400 printer. Now, the app crashes at the point where I restore the SetupString.

ps = New PrinterSetup
ps.SetupString = SavedString   // crashes here

I saw a similar thing with another client that wanted to print to their new fancy Canon copier. I got that to work by dumbing down the printer driver. I installed a second Windows printer and changed the driver to LaserJet 2200.

But now that it has happened again, I wonder if we’re going to have problems on Windows with newer, fancier printers. Has anyone else run into a problem restoring a saved setupstring?

Yes - last friday . I do the same thing with setup strings. A user requested a change to a central Xerox copier and It crashes. That being said It works fine from my workstation. I am running win 7 pro on a VM. He is running win 7 pro on a Dell box. It was late friday so we shelved it and I have not gotten back to it yet.

I’m off today but will look into the driver possibility. I know mine “could” be an older driver.

There’s Feedback report #9663, but no workarounds. There’s also #38285 and #27113.

You might also look at #38613.

One problem I’ve found is that if you save the printer info and restore it the next time the app runs, if the user has changed the printer or the printer that was used isn’t available anymore, then the setup string is invalid and the app crashes hard. I’ve tried lots of workarounds with keeping track of which printer was used and whether or not it’s still available, but with poor results every time.

I finally changed my app so that it makes users do the printer setup window the first time they print after launch, before going to the print window.