Question Type 'Word.application' is not defined error

lala1974

New member
Joined
Aug 12, 2008
Messages
1
Programming Experience
Beginner
I am using Visual Studio 2005, version 2.0 on windows xp.
I am getting the below errors when I try to open a project that was done months ago:

Type 'Word.application' is not defined error
Type 'Excel.worksheet' is not defined error

I have recently upgraded to Outlook 2007 from 2003.
Can someone advise on how to fix it, please? I have searched the web, but I cannot find anything relevant.
Thanks
 
Sounds strange if you had a working project before, to use a type you first need a reference, so if the library was "removed" you should be getting a reference error, not a type error.
To use Office automation libraries you need the official Primary Interop Assemblies (PIA) installed for the version you're working against, then you add reference in project to the correct type library, this is just to be able to import these types and use them in code. At runtime the correct version Office libraries must be installed in client system for the code to actually work.
 
Back
Top