Word object library

M

Matthias Langbein

Hi all,

I'm developing a word add-in which I want to distribute. The add-in
needs a reference to the Microsoft Word Object Library.
As I have installed Office 2007 beta for testing, the Microsoft Word
12.0 Object Library is included with the setup project. But I want the
add-in to run on every Word version, from word 97 (8.0) till Word 2007
(12.0).

It seems that the dll-versions are not downward-compatibe?

How can I achive that the add-in runs on any word version? Do I need
to include all Microsoft.Office.Interop.Word.dll versions? And if so,
how does Windows/Word know which one to use? Do I have to set anything
up?

Thanks for the help!

Langi
 
C

Cindy M.

Hi Matthias,
I'm developing a word add-in which I want to distribute. The add-in
needs a reference to the Microsoft Word Object Library.
As I have installed Office 2007 beta for testing, the Microsoft Word
12.0 Object Library is included with the setup project. But I want the
add-in to run on every Word version, from word 97 (8.0) till Word 2007
(12.0).

It seems that the dll-versions are not downward-compatibe?

How can I achive that the add-in runs on any word version? Do I need
to include all Microsoft.Office.Interop.Word.dll versions? And if so,
how does Windows/Word know which one to use? Do I have to set anything
up?
Word 97 doesn't have the interface to support COM Add-ins, so you can
scratch that off your list...

Managed code interfaces with Office COM components using "Interop
Assemblies" (IAs). For Word 2002 and later, Microsoft has provided
Primary IAs (PIAs) that are optimized to work with that version of Word.

For earlier versions, you can use TlbImp.exe to generate your own set of
IAs and distribute it with your solution.

Because each version adds functionality, if you program against a later
version it will contain and reference things not available in the older
version. The Office teams try very hard to ensure backwards
compatibility, so something developed against an earlier version can -
if you're lucky! - be used with newer versions.

IOW, you can try programming your SHARED Add-in (not VSTO, that's only
supported back to Word 2003) against Office 2000, generating and
distributing the IAs with it.

Note, please, that Microsoft does not support this scenario. They
recommend a separate solution for each version you support.

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 :)
 
M

Matt M

Hey Cindy,

I'm having a slightly similar problem in that I need to use the interops to
automate Outlook 2003 and Outlook 2007. I have Office 2007 installed on my
dev box, I can get the application to compile however when I move the
application to my test box that is running 2003 it breaks because it's
looking for the 2007 interops.

I guess my question is can I have both sets of interops on my dev box? As I
understand it you have to have that version of office installed in order to
get this to work. The application only uses functionality availbe to it for
that version of office.
 
C

Cindy M.

Hi Matt,
I'm having a slightly similar problem in that I need to use the interops to
automate Outlook 2003 and Outlook 2007. I have Office 2007 installed on my
dev box, I can get the application to compile however when I move the
application to my test box that is running 2003 it breaks because it's
looking for the 2007 interops.

I guess my question is can I have both sets of interops on my dev box? As I
understand it you have to have that version of office installed in order to
get this to work. The application only uses functionality availbe to it for
that version of office.
Please note that I'm not particularly knowledgeable when it comes to Outlook
:) I can use it, but I never try to program it...

That said, it's not possible to have more than one version of Outlook
installed on a machine. Outlook simply does not allow it. So the answer to
your specific question is, NO. Many of us use virtual machines and
program/test in the specific environment.

Whether you could program against Outlook 2003 and have it run with Outlook
2007: I don't know. My advice is to ask in the outlook programming newsgroup.
Or at least post this as a separate question so that Outlook specialists, such
as Ken Slovak and Sue Mosher see it.

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 :)
 
K

Ken Slovak - [MVP - Outlook]

Hi Cindy :)

An Outlook addin compiled under Outlook 2003 would work unchanged in Outlook
2007. Of course it couldn't use any of the new properties or methods without
late binding them and none of the new events.
 

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