Error 5151 creating Word document
-
Hello! I have an older C++ application that uses the Word.Application object to create and open a Word document from a template. I have installed my application on a new server running Windows server 2008 (32bit) and now the Word-connection gives me trubble, Word starts an instance but no document is created and I recieve the error: 5151 Word was unable to read this document. It may be corrupt. Try one or more of the following: * Open and Repair the file. * Open the file with the Text Recovery converter. The application works fine when I run it on my computor (XP 32bit) as well as on a Win 2008 64bit server (and various Win 2003 32-bit servers). I think there is some problem when creating and loading the Normal.dotm-file but there is no problem opening the template in Word nor opening the Normal.dotm-file that is created. I tried Repair as well as uninstalling and reinstalling Office 2007. Any ideas? Thanks!
-
Hello! I have an older C++ application that uses the Word.Application object to create and open a Word document from a template. I have installed my application on a new server running Windows server 2008 (32bit) and now the Word-connection gives me trubble, Word starts an instance but no document is created and I recieve the error: 5151 Word was unable to read this document. It may be corrupt. Try one or more of the following: * Open and Repair the file. * Open the file with the Text Recovery converter. The application works fine when I run it on my computor (XP 32bit) as well as on a Win 2008 64bit server (and various Win 2003 32-bit servers). I think there is some problem when creating and loading the Normal.dotm-file but there is no problem opening the template in Word nor opening the Normal.dotm-file that is created. I tried Repair as well as uninstalling and reinstalling Office 2007. Any ideas? Thanks!
Are you using an
#import
directive with a specific version of Word?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
Are you using an
#import
directive with a specific version of Word?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
From what I can tell there is no connection to a specific version of Word. The same version of Word is running on the server where I get the error as on my computer and on the other server where I don't get the error...
By the way - the application can create and open Excel-documents without problems on the same server and the application is run interactively by a logged on user. The error occurs no matter whether the user has administrator rights or just "normal" user rights to the server.
modified on Monday, February 22, 2010 10:11 AM
-
Hello! I have an older C++ application that uses the Word.Application object to create and open a Word document from a template. I have installed my application on a new server running Windows server 2008 (32bit) and now the Word-connection gives me trubble, Word starts an instance but no document is created and I recieve the error: 5151 Word was unable to read this document. It may be corrupt. Try one or more of the following: * Open and Repair the file. * Open the file with the Text Recovery converter. The application works fine when I run it on my computor (XP 32bit) as well as on a Win 2008 64bit server (and various Win 2003 32-bit servers). I think there is some problem when creating and loading the Normal.dotm-file but there is no problem opening the template in Word nor opening the Normal.dotm-file that is created. I tried Repair as well as uninstalling and reinstalling Office 2007. Any ideas? Thanks!
After placing a number of printouts down in the class using the Word.Application objekt I found out that the error occured doing Documents.Add(@"\\path\OurTemplate"), there seems to be some filetype association missing on the server which is in place on the other servers where the same code works fine. Changing to Documents.Add(@"\\path\OurTemplate.dot"), i.e. explicitly specifying the file suffix solved the problem. Why the suffix was not supplier from the begining I can't say - this code was written long before my time here...