C# Interaction with Word on multiple versions (MS Office 2000/2003/2007)
-
I have a program that creates and edits Microsoft Word documents. It was created with Microsoft Word 12.0 Object Library -- I had MS Office 2007 installed. I built it and it worked great on my computer. I took it to another computer (one that had MS Office 2003 installed) and it crashes when I tell the program to create the Word document. This is the error I get (in the Details section): System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' Is there a way to make sure the program can be backward and forward compatible with regard to versions of Microsoft Word? Thanks.
-
I have a program that creates and edits Microsoft Word documents. It was created with Microsoft Word 12.0 Object Library -- I had MS Office 2007 installed. I built it and it worked great on my computer. I took it to another computer (one that had MS Office 2003 installed) and it crashes when I tell the program to create the Word document. This is the error I get (in the Details section): System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' Is there a way to make sure the program can be backward and forward compatible with regard to versions of Microsoft Word? Thanks.
danielhasdibs wrote:
Is there a way to make sure the program can be backward and forward compatible with regard to versions of Microsoft Word?
danielhasdibs wrote:
I took it to another computer and it crashes
danielhasdibs wrote:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Interop.Word
Well until you get that file installed on that computer to eliminate that error you don't even know if you have a compatibility problem. :rolleyes:
led mike
-
danielhasdibs wrote:
Is there a way to make sure the program can be backward and forward compatible with regard to versions of Microsoft Word?
danielhasdibs wrote:
I took it to another computer and it crashes
danielhasdibs wrote:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Interop.Word
Well until you get that file installed on that computer to eliminate that error you don't even know if you have a compatibility problem. :rolleyes:
led mike
Clarification: "took it to another computer" means installed it onto another computer. Jeez, if you don't know what's wrong don't bother replying.
-
Clarification: "took it to another computer" means installed it onto another computer. Jeez, if you don't know what's wrong don't bother replying.
danielhasdibs wrote:
Jeez, if you don't know what's wrong don't bother replying.
Wow, the error message is perfectly clear asshole so fuck off
danielhasdibs wrote:
The system cannot find the file specified. File name: 'Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
led mike
-
I have a program that creates and edits Microsoft Word documents. It was created with Microsoft Word 12.0 Object Library -- I had MS Office 2007 installed. I built it and it worked great on my computer. I took it to another computer (one that had MS Office 2003 installed) and it crashes when I tell the program to create the Word document. This is the error I get (in the Details section): System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' Is there a way to make sure the program can be backward and forward compatible with regard to versions of Microsoft Word? Thanks.
This program was originally written with library 11.0 -- it worked with computers that had MS Office 2003 and 2007, I updated it when I upgraded to MS Office 2007 using library 12.0, and now it does not work with MS Office 2003. How can I get it to work with 12.0? Thanks.
-
This program was originally written with library 11.0 -- it worked with computers that had MS Office 2003 and 2007, I updated it when I upgraded to MS Office 2007 using library 12.0, and now it does not work with MS Office 2003. How can I get it to work with 12.0? Thanks.
-
I have a program that creates and edits Microsoft Word documents. It was created with Microsoft Word 12.0 Object Library -- I had MS Office 2007 installed. I built it and it worked great on my computer. I took it to another computer (one that had MS Office 2003 installed) and it crashes when I tell the program to create the Word document. This is the error I get (in the Details section): System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' Is there a way to make sure the program can be backward and forward compatible with regard to versions of Microsoft Word? Thanks.
AFAIK you need to either explicitly link against the lowest supported version (not sure the old dlls are forward compatable), or build a switcher that links against every possible version you're using it on depending on availability. You could also try putting the v12 dll on the system with word 2003 (v11), but IIRC that won't work.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots. -- Robert Royall