Replacing text in Microsoft Word 97 with C#
I am writing a program that, in part, replaces text in a word document. Currently, I am referencing the Microsoft.Office.Interop.Word assembly, however, I am receiving an error when running the program on a machine with Word 97 installed.
Everything works perfectly on my development machine, but I need it to also work with Word 97. Is there a fairly quick solution? Or does my problem come from something else? The only error I have to go by at this point is "Could not load file or assembly "Microsoft.Offi开发者_Python百科ce.Interop.Word, Version=14.0.0.0, ..."
I don't necessarily need it to work with more recent versions of Word, however, if the client updates their version of Word, it would be nice if the program didn't break. Any ideas?
I picked this project up from another developer without much previous knowledge. Will I need a lot of redesign of my code to make this compatible with Word 97?
You need to set your Reference Properties for the Word reference to have Specific Version
set to false
. You will have to test your program when new versions of Word come out to make sure the APIs you reference still exist. You may have to rewrite parts of your application for Word 97 because some of the APIs you use may not be present
精彩评论