Freigeben über


FAQ: Where are the Office PIAs?

This has become a frequently asked question--where are the Office PIAs?

The Office XP PIAs are available here: https://www.microsoft.com/downloads/details.aspx?FamilyId=C41BD61E-3060-4F71-A6B4-01FEBA508E52&displaylang=en

The Office 2003 PIAs are available through the Office 2003 installer. To be sure they get installed, when you do a setup check the "Choose advanced customization of applications." checkbox. Then in the tree control that appears in the next screen of the wizard, you will see a ".NET Programmability Support" under each application for which PIAs are available. Click on each of these .NET programmability support nodes and make sure that it is set to "Run from my computer". Also, under Office Tools you may want to turn on Microsoft Forms 2.0 .NET Programmability Support and Smart Tag .NET Programmability support.

I've been told that if you do a "Complete" install of Office 2003, all the .NET programmability support will be turned on for you automatically, but my suspicious nature forces me to checked the advanced customization of applications checkbox. 

Also, to answer the "Where are the Office PIAs" question in another way--the Office PIAs get installed to the global assembly cache aka the GAC (I always think of Bill the cat when I write that acronym). On my machine, the gac is at C:\windows\assembly\gac. It is probably in a similar location on your machine depending on what your windows directory name is.

Finally, the "Where do I go to add a reference to the Office PIA in Visual Studio" question. You can go to the COM tab of the Add Reference dialog that appears when you right click on the references node in your project. Then you will pick "Microsoft Excel 11.0 Object Library" to add the Excel 2003 PIA, "Microsoft Word 11.0 Object Library" to add the Word 2003 PIA, and "Microsoft Office 11.0 Library" to add the common Office PIA that has objects like CommandBars that are shared across Office applications. Two points about this dialog. First, 11.0 corresponds to Office 2003 and 10.0 corresponds to Office XP so to add the Office XP PIA you would add "Microsoft Excel 10.0 Object Library" assuming you had installed the Office XP PIA pack on your box. Second, the "path" column in the COM tab of the Add References dialog displays the path to the COM object that the PIA wraps. For example, the Microsoft Excel 11.0 Object Library points to the location on your machine of the Excel.EXE executable. When you select these references and close the dialog, examine the properties of the actual references that get added by right clicking on the references and choosing Properties. You will see that Visual Studio figures out the PIA managed object in your GAC that corresponds to the COM object you selected. So you don't get a reference to the Excel.EXE executable but instead to Microsoft.Office.Interop.dll in the GAC.