Link to home
Start Free TrialLog in
Avatar of enkotec
enkotecFlag for United States of America

asked on

"4120: Bad parameter" error when printing Word-based report from VB app

I have an application that uses a locked Access 2000 database and is built in VB.  Reports for the data are generated in MS Word.  I have Office 2007 installed on WinXP SP2.  When I try to print or preview a report from the application, I get "4120: Bad parameter".  The application has multiple Word template styles available; I've tried all of them and get the same result.  The only way I can print reports from this app is by using the "dot matrix" style, which does not use MS Word and can only be printed (no preview).  

Outside the 3rd party app, Word opens normally, and new or saved documents print normally.  The only time the error occurs is when trying to print or preview reports from this 3rd party application.  

I'm happy to provide more specific information as soon as I know what is needed.  Thanks!
Avatar of adraughn
adraughn
Flag of United States of America image

My suggestion would be to temporarily remove error handling in the VB app for the mod that is used to print the report, then run again and see which line breaks. then post the line. (along with the rest of the code) you said it was written in VB. VBA? VB6? VB.net?

adria
ASKER CERTIFIED SOLUTION
Avatar of stevbe
stevbe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of enkotec

ASKER

I'm not sure which version of VB it's written in, and I have no way to open the app in VB since it's a vendor's product.  The vendor insists they tested it with Office 97 and they've never seen this error.  It works with Word 2003, but as soon as I re-install Word 2007 I'm back to the "4120" error.  Event Viewer doesn't show anything related.  I'm trying to find out if there are relevant error logs for the app that might shed light on the problem.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of enkotec

ASKER

No access to the code.  Vendor says they tested on Office 2k7 and haven't seen this error.    Error log for app just says "4120 Bad parameter".  I guess I'm at a roadblock.  There's no information from MS about this error with Office 2k7, so it's either an app-specific problem or an as yet unknown issue with Word 2k7.  Thanks for the input.
Avatar of enkotec

ASKER

Actual solution found:  
The cause of the error was what appears to be a bug in Word 2007.  If the User Name field in the Word Options > Popular pane is not populated, or contains only spaces, the error occurs.  Populating the User Name field resolved the problem.