non Version-neutral PIA's with Office 2003

Add-in Express™ Support Service
That's what is more important than anything else

non Version-neutral PIA's with Office 2003
 
ron vader




Posts: 8
Joined: 2006-08-28

I've created an add-in using ADX 2007 and have specified to use the Office 2007 PIA's ("Use Version-neutral Office PIA's" is *not* checked). I have some code in that explicitly references the Microsoft.Office.Core (Office.dll) namespace, in particular the CommandBar object.

I've installed the addin on a machine with Office 2003 (has never had Office 2007 installed) and the CommandBar code functions as expected. I'll spare you the gorey details of why I chose this approach, but my question is...

Will installing an addin that references Office.dll version 12 on an Office 2003 machine cause problems? note this is a local reference to Office.dll installed with the addin (ie. will not reference the assembly in the GAC).

thanks in advance, ron.
Posted 18 Jan, 2007 10:35:54 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ron.

The fact is that Add-in Express based add-ins don't depend on PIAs version.
However if you try to use some specific types of Office 2007 on a PC with Office 2003 installed, you will get exceptions. So I would advise you to use PIAs for Office 2003. In this case the add-in will work properly in both versions of MS Office.


P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.



Posted 18 Jan, 2007 10:52:15 Top
ron vader




Posts: 8
Joined: 2006-08-28

understood, and I'm doing the appropriate version checking in the code to make certain I'm not calling any Office 2007 API's when loaded by Word 2003, for instance.

however, my addin does some unconventional stuff with command bars that you have confirmed is not supported by ADX, therefore I cannot rely on the version transparency offered by ADX. since Office.dll v12 is a superset of v11, the CommandBar API's in v12 remain consistent with Office2003.

so my question remains (assuming I use the appropriate API's for the version of Office loading the addin) will there be a problem if my addin references the Office v12 assembly when loaded by Office 2003?
Posted 18 Jan, 2007 11:20:04 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Yes, you will certainly face problems using your approch.
There is the InvokeMember function in the System.Type class that allows you to use late binding in the add-in code. E.g. if you use any specific methods or properties of Offide 2007 (and use PIAs for Office 2003), you can use the InvokeMember function to call such methods/properties directly and you don't need PIAs at all.
Posted 18 Jan, 2007 11:32:23 Top