System.InvalidCastException: QueryInterface for interface Word._Application failed.

E

Eric

I am developing an application to perform an automated mail merge
using MS Word 2000 (version 9), however when installing Visual Studio
..NET, the application installed the core components from the MS Office
object model for Office XP (version 10). So when the code is
compiled, it is compiled using the Word (v9) DLL and the Office (v10)
DLL, but when it is deployed to the server it fails. This is caused
by the server only having Word (v9) and Office (v9) installed. We
need to also install the core Office XP (v10) components on the
servers as well. I am tring to figure out a way to do this in a clean
way. One option would be to install VS .NET onto the server. This
is, in my opinion, overkill to get a few DLLs onto the sever, but it
works.

Does Microsoft have a way to install only the core Office XP
components?

Has anyone else found a workaround for this problem?

Regards,
Eric
 
C

Cindy M -WordMVP-

Hi Eric,

You generally won't find a lot of NET knowledge in this group, one of the
dotnet groups might be better. I've been "dabbling" a bit, but am not
familiar with anything in the area where you're searching. HOWEVER

If the user is running Word 9.0, I think your project has to reference
the Word 9.0 object library OR use late binding. I know for certain that
in a VB(A) project (for example), you can't set a reference to the Word
10.0 library and run the project in an earlier version of Word. The
reverse will usually work, but not the other way around.

I'm also fairly sure that the two versions require separte sets of PIAs,
if that helps you at all. Also, Office 2K is installed on your
development machine you can set references to these libraries for the
project (you have to "browse" for them) instead of to Office 10. And this
should generate a set of PIAs, as I recall.
I am developing an application to perform an automated mail merge
using MS Word 2000 (version 9), however when installing Visual Studio
..NET, the application installed the core components from the MS Office
object model for Office XP (version 10). So when the code is
compiled, it is compiled using the Word (v9) DLL and the Office (v10)
DLL, but when it is deployed to the server it fails. This is caused
by the server only having Word (v9) and Office (v9) installed. We
need to also install the core Office XP (v10) components on the
servers as well. I am tring to figure out a way to do this in a clean
way. One option would be to install VS .NET onto the server. This
is, in my opinion, overkill to get a few DLLs onto the sever, but it
works.

Does Microsoft have a way to install only the core Office XP
components?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top