Skip to main content
Microsoft 365

2007 Microsoft Office System Primary Interop Assemblies

Today we have the first of two guest posts from Patrick Smith, a program manager on the Office Programmability team.

Writing managed code against the 2007 Microsoft Office System products requires the use of an interop assembly. Just as we did with Microsoft Office System 2003, we are providing primary interop assemblies with the new 2007 Office. We’ve also made some changes to make the PIA’s a better experience with 2007. Among the areas we’ve addressed are:

  • Installation
  • Redistribution
  • Backward Compatibility

Installation

In Office 2003, the PIA’s were set as an Install on Demand feature within Office Setup.  This caused some headaches for the Office developer because you could never know for sure if the PIA’s were installed on the machine where you were installing your managed add-in. With 2007, we will be changing the default feature state for the PIA’s to install locally.  While this will narrow the cases where the PIA’s are not installed on the machine, it doesn’t take care of 100% of the scenarios such as the .NET Framework being present on the machine during the Office installation. To catch these other scenarios, we will also release a PIA Redistributable package.

Redistribution

During the spring of 2005, we released a PIA redistributable for the 2003 Office PIA’s which now gives you the license to redistribute the PIA’s with your solution.  With 2007 Office System, we are releasing another redistributable containing the 2007 PIA’s and associated supporting files.  Now, by taking the redistributable package and shipping it with your project, you can ensure that the PIA’s are installed properly when you install your solution.

Backward Compatibility

Backward Compatibility is an area we where have focused much attention.  We understand that as a platform, we must take steps to ensure that the managed solutions compiled against a 2003 PIA will continue to run properly against the 2007 version.  To do this, we’ve taken some great strides during development of the individual object model to ensure that the changes to the OM do not break runtime compatibility.  

In conjunction with the OM compatibility work we have done, we are also shipping publisher policy files for the Office PIA’s.  These will automatically redirect code that is compiled against the 2003 PIA to the new 2007 PIA so that existing code compiled against a 2003 PIA will automatically be redirected to the corresponding 2007 PIA.  As with any publisher policy, in cases where you may not want to redirect code to call the new PIA, you can override the policy by using the following tag in an application configuration file shipped with your managed assembly.

<publisherPolicy apply=”no”/>