Group:  Microsoft Word ยป microsoft.public.word.oleinterop
Thread: Developed in Word 2007, user has 2003. App Crashes

Geek News

Developed in Word 2007, user has 2003. App Crashes
Phil 5/11/2007 2:49:01 PM
I have a C#/.Net 2.0 app that I developed that has an interface into Word
using the WORD.OLB from Word 2007.

using Microsoft.Office.Interop.Word;

When I deploy the app on another computer with Word 2003, the app raises an
unhandled exception:

Could not load file or assemble 'Microsoft.Office.Interop.Word. Version
12.0.0.0


How do I make this work for users that have Word 2003 or older?

Thanks,

Phil

Re: Developed in Word 2007, user has 2003. App Crashes
Cindy M. <C.Meister-C[ at ]hispeed.ch> 5/11/2007 6:00:56 PM
Hi =?Utf-8?B?UGhpbA==?=,

[Quoted Text]
> I have a C#/.Net 2.0 app that I developed that has an interface into Word
> using the WORD.OLB from Word 2007.
>
> using Microsoft.Office.Interop.Word;
>
> When I deploy the app on another computer with Word 2003, the app raises an
> unhandled exception:
>
> Could not load file or assemble 'Microsoft.Office.Interop.Word. Version
> 12.0.0.0
>
> How do I make this work for users that have Word 2003 or older?
>
You open it in Visual Studio, link it to the Office 2003 instead of 2007 PIAs,
and test to make sure your code doesn't contain anything that's not available
in the earlier version. Pay special attention to method signatures, as the
Office object models are VB-based and tend to accumulate additional optional
parameters in newer versions.

Quite often, you can put an app developed against an earlier version on a
machine with a newer version and it will run. But it's very chancy with C#,
due to those method signatures.

MSFT "best practice" is to develop/distribute a separate application for each
version of Office, thoroughly tested against that version.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net