A bit about Microsoft Office PIAs

Posted on Wednesday, March 1st, 2006 at 12:07 pm by Eugene Starostin

Today I’ve got seized by inspiration. Don’t know how to cope with it. Hey, somebody, stop me! :-) All in all, I’ve come to one of the key issues. What is the Office PIAs and what should we do with them? Ок, to start with, a few words about PIAs, primary interop assemblies.

There was OLE first, remember? Next there’s OLE Automation. After that came COM, DCOM and COM+. Do you remember what type libraries ITypeInfo and ITypeInfo2 are? PIAs are, in fact, a COM type library imported to .NET. But not to IDL. PIAs are much more comfortable to use because it is a set of .NET classes that wrap all interfaces of a COM type library. And the Office PIAs are an imported MS Office type library. For more details, please see the links below. I will just say that they are very easy to use. All in all, I recommend.

However, there’s one problem here. There are official PIAs for Office XP and Office 2003 published by Microsoft. For Office 2000 there’re no official PIAs. Meanwhile, Microsoft says:

Microsoft does not guarantee that the Office PIAs will be backwardly compatible or that the Office XP PIAs and the Office 2003 PIAs can be run side-by-side in the same instance of an Office application. Office XP managed code add-ins must be built against the Office XP PIAs. The Office 2003 managed code add-ins must be built against the Office 2003 PIAs. Therefore, if you build an add-in solution that you intend to use with both versions of Office, Microsoft recommends that you build a version of your add-in for each version of Office that you intend to support.

Scaring, isn’t it? But do you want to create special versions of your add-in for Office 2000, XP, 2003 and 2007? Or have you customers already upgraded their Office to 2007? I answered this question long ago. I use Office 2000 PIAs generated by myself for add-ins that must work in all available versions of Microsoft Office. If the add-in is to work in Office XP and higher, I use the official Office XP PIAs. And it works in spite of the fact that Microsoft doesn’t guarantee it. I know the reasons why it is no guaranteed. But I will not tell you about them, because my inspiration is exhausted. Today I was helped by Mark Knopfler from his Shangri-La. :-)

Last updated on 13-May-2008.
Now Add-in Express 2008 for Office and .NET provides the PIAs mentioned above to allow the developer to create COM add-ins that support all Office versions across 2000 through Office 2007. See Version-independent Office PIAs for more details.

Links

A wonderful article about Office PIAs by Chris Kunicki:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnofftalk/html/office10032002.asp

Working with the Office XP Primary Interop Assemblies:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_oxppias.asp

Installing and Using the Office 2003 Primary Interop Assemblies:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dno2k3ta/html/OfficePrimaryInteropAssembliesFAQ.asp

Download Official Office 2003 PIAs:
http://support.microsoft.com/default.aspx?scid=kb;en-us;897646

Download Official Office XP PIAs:
http://www.microsoft.com/downloads/details.aspx?FamilyId=C41BD61E-3060-4F71-A6B4-01FEBA508E52&displaylang=en

Related posts:

Add-in Express .NET and Microsoft Office PIAs

Post a Comment

You must be logged in to post a comment.