Skip to content

Commit 1a8b644

Browse files
authored
Merge pull request #1549 from Linda-Editor/patch-1
Added some links to PIAs; light edit pass
2 parents a2d8a66 + 8970265 commit 1a8b644

File tree

1 file changed

+71
-50
lines changed

1 file changed

+71
-50
lines changed
Lines changed: 71 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Office primary interop assemblies"
33
ms.custom: ""
4-
ms.date: "02/02/2017"
4+
ms.date: "09/20/2018"
55
ms.technology:
66
- "office-development"
77
ms.topic: "conceptual"
@@ -18,100 +18,121 @@ manager: douge
1818
ms.workload:
1919
- "office"
2020
---
21+
2122
# Office primary interop assemblies
22-
To use the features of a Microsoft Office application from an Office project, you must use the primary interop assembly (PIA) for the application. The PIA enables managed code to interact with a Microsoft Office application's COM-based object model.
23+
24+
To use the features of a Microsoft Office application from an Office project, you must use the primary interop assembly (PIA) for the application. The PIA enables managed code to interact with a Microsoft Office application's COM-based object model.
2325

24-
When you create a new Office project, Visual Studio adds references to the PIAs that are required to build the project. In some scenarios, you might need to add references to additional PIAs (for example, if you want to use a feature of Microsoft Office Word in a project for Microsoft Office Excel).
26+
When you create a new Office project, Visual Studio adds references to the PIAs that are required to build the project. In some scenarios, you might need to add references to additional PIAs (for example, if you want to use a feature of Microsoft Office Word in a project for Microsoft Office Excel).
2527

26-
This topic describes the following aspects of using the Microsoft Office PIAs in Office projects:
28+
This topic describes the following aspects of using the Microsoft Office PIAs in Office projects:
2729

28-
- [Separate primary interop assemblies to build and run projects](#separateassemblies)
30+
- [Separate primary interop assemblies to build and run projects](#separateassemblies)
2931

30-
- [Use features of multiple Microsoft Office applications in a single project](#usingfeatures)
32+
- [Use features of multiple Microsoft Office applications in a single project](#usingfeatures)
3133

32-
- [Full list of primary interop assemblies for Microsoft Office applications](#pialist)
34+
- [Full list of primary interop assemblies for Microsoft Office applications](#pialist)
3335

34-
For more information about primary interop assemblies, see [Primary interop assemblies](http://msdn.microsoft.com/b977a8be-59a0-40a0-a806-b11ffba5c080).
36+
For more information about primary interop assemblies, see [Primary interop assemblies](http://msdn.microsoft.com/b977a8be-59a0-40a0-a806-b11ffba5c080).
37+
38+
<a name="separateassemblies"></a>
39+
40+
## Separate primary interop assemblies to build and run projects
41+
42+
Visual Studio uses different sets of the PIAs on the development computer. These different sets of assemblies are in the following locations:
3543

36-
## <a name="separateassemblies"></a> Separate primary interop assemblies to build and run projects
37-
Visual Studio uses different sets of the PIAs on the development computer. These different sets of assemblies are in the following locations:
44+
- A folder in the program files directory
3845

39-
- A folder in the program files directory.
46+
These copies of the assemblies are used when you write code and build projects. Visual Studio installs these assemblies automatically.
4047

41-
These copies of the assemblies are used when you write code and build projects. Visual Studio installs these assemblies automatically.
48+
- The global assembly cache
4249

43-
- The global assembly cache.
44-
45-
These copies of the assemblies are used during some development tasks, such as when you run or debug projects. Visual Studio does not install and register these assemblies; you must do this yourself.
50+
These copies of the assemblies are used during some development tasks, such as when you run or debug projects. Visual Studio does not install and register these assemblies; you must do this yourself.
4651

4752
### Primary interop assemblies in the program files directory
48-
When you install Visual Studio, the PIAs are automatically installed to a location in the file system, outside of the global assembly cache. When you create a new project, Visual Studio automatically adds references to these copies of the PIAs to your project. Visual Studio uses these copies of the PIAs, instead of the assemblies in the global assembly cache, to resolve type references when you develop and build your project.
53+
54+
When you install Visual Studio, the PIAs are automatically installed to a location in the file system, outside of the global assembly cache. When you create a new project, Visual Studio automatically adds references to these copies of the PIAs to your project. Visual Studio uses these copies of the PIAs, instead of the assemblies in the global assembly cache, to resolve type references when you develop and build your project.
4955

50-
These copies of the PIAs help Visual Studio avoid several development issues that can occur when different versions of the PIAs are registered in the global assembly cache.
56+
These copies of the PIAs help Visual Studio avoid several development issues that can occur when different versions of the PIAs are registered in the global assembly cache.
5157

52-
Visual Studio installs these copies of PIAs to the following locations on the development computer:
58+
Visual Studio installs these copies of PIAs to the following locations on the development computer:
5359

54-
- *%ProgramFiles%\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office14*
60+
- *%ProgramFiles%\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office14*
5561

56-
(or *%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office14* on 64-bit operating systems)
62+
(or *%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office14* on 64-bit operating systems)
5763

58-
- *%ProgramFiles%\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office15*
64+
- *%ProgramFiles%\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office15*
5965

60-
(or *%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office15* on 64-bit operating systems)
66+
(or *%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office15* on 64-bit operating systems)
6167

6268
### Primary interop assemblies in the global assembly cache
63-
To perform certain development tasks, the PIAs must be installed and registered in the global assembly cache on the development computer. Typically, the PIAs are installed automatically when you install Office on the development computer. For more information, see [Configure a computer to develop Office solutions](../vsto/configuring-a-computer-to-develop-office-solutions.md).
64-
65-
The Office PIAs are not required on end-user computers to run Office solutions. For more information, see [Design and create Office solutions](../vsto/designing-and-creating-office-solutions.md).
69+
70+
To perform certain development tasks, the PIAs must be installed and registered in the global assembly cache on the development computer. Typically, the PIAs are installed automatically when you install Office on the development computer. For more information, see [Configure a computer to develop Office solutions](../vsto/configuring-a-computer-to-develop-office-solutions.md).
6671

67-
## <a name="usingfeatures"></a> Use features of multiple Microsoft Office applications in a single project
68-
Every Office project template in Visual Studio is designed to work with a single Microsoft Office application. To use features in multiple Microsoft Office applications, or to use features in an application or component that does not have a project in Visual Studio, you must add a reference to the required PIAs.
72+
The Office PIAs are not required on end-user computers to run Office solutions. For more information, see [Design and create Office solutions](../vsto/designing-and-creating-office-solutions.md).
73+
74+
<a name="usingfeatures"></a>
75+
76+
## Use features of multiple Microsoft Office applications in a single project
77+
78+
Every Office project template in Visual Studio is designed to work with a single Microsoft Office application. To use features in multiple Microsoft Office applications, or to use features in an application or component that does not have a project in Visual Studio, you must add a reference to the required PIAs.
6979

70-
In most cases, you should add references to the PIAs that are installed by Visual Studio under the *%ProgramFiles%\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\* directory. These versions of the assemblies appear on the **Framework** tab of the **Reference Manger** dialog box. For more information, see [How to: Target Office applications through primary interop assemblies](../vsto/how-to-target-office-applications-through-primary-interop-assemblies.md).
80+
In most cases, you should add references to the PIAs that are installed by Visual Studio under the `%ProgramFiles%\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\` directory. These versions of the assemblies appear on the **Framework** tab of the **Reference Manager** dialog box. For more information, see [How to: Target Office applications through primary interop assemblies](../vsto/how-to-target-office-applications-through-primary-interop-assemblies.md).
7181

72-
If you have installed and registered the PIAs in the global assembly cache, these versions of the assemblies appear on the **COM** tab of the **Reference Manager** dialog box. You should avoid adding references to these versions of the assemblies, because there are some development issues that can occur when you use them. For example, if you have registered different versions of the PIAs in the global assembly cache, your project will automatically bind to the version of the assembly that was registered last—even if you specify a different version of the assembly on the **COM** tab of the **Reference Manager** dialog box.
82+
If you have installed and registered the PIAs in the global assembly cache, these versions of the assemblies appear on the **COM** tab of the **Reference Manager** dialog box. You should avoid adding references to these versions of the assemblies, because there are some development issues that can occur when you use them. For example, if you have registered different versions of the PIAs in the global assembly cache, your project will automatically bind to the version of the assembly that was registered last—even if you specify a different version of the assembly on the **COM** tab of the **Reference Manager** dialog box.
7383

7484
> [!NOTE]
7585
> Some assemblies are added to a project automatically when an assembly that references them is added. For example, references to the *Office.dll* and *Microsoft.Vbe.Interop.dll* assemblies are added automatically when you add a reference to the Word, Excel, Outlook, Microsoft Forms, or Graph assemblies.
76-
77-
## <a name="pialist"></a> Primary interop assemblies for Microsoft Office applications
78-
The following table lists the primary interop assemblies that are available for [!INCLUDE[Office_15_short](../vsto/includes/office-15-short-md.md)] and [!INCLUDE[office14_long](../vsto/includes/office14-long-md.md)].
79-
86+
87+
<a name="pialist"></a>
88+
89+
## Primary interop assemblies for Microsoft Office applications
90+
91+
The following table lists the primary interop assemblies that are available for [!INCLUDE[Office_15_short](../vsto/includes/office-15-short-md.md)] and [!INCLUDE[office14_long](../vsto/includes/office14-long-md.md)].
92+
93+
<br/>
94+
8095
|Office application or component|Primary interop assembly name|
8196
|-------------------------------------|-----------------------------------|
8297
|Microsoft Access 14.0 Object Library<br /><br /> Microsoft Access 15.0 Object Library|Microsoft.Office.Interop.Access.dll|
8398
|Microsoft Office 14.0 Access Database Engine Object Library<br /><br /> Microsoft Office 15.0 Access Database Engine Object Library|Microsoft.Office.Interop.Access.Dao.dll|
84-
|Microsoft Excel 14.0 Object Library<br /><br /> Microsoft Excel 15.0 Object Library|Microsoft.Office.Interop.Excel.dll|
99+
|Microsoft Excel 14.0 Object Library<br /><br /> Microsoft Excel 15.0 Object Library|[Microsoft.Office.Interop.Excel.dll](https://docs.microsoft.com/dotnet/api/microsoft.office.interop.excel?view=excel-pia)|
85100
|Microsoft Graph 14.0 Object Library (used by PowerPoint, Access, and Word for graphs)<br /><br /> Microsoft Graph 15.0 Object Library|Microsoft.Office.Interop.Graph.dll|
86-
|Microsoft InfoPath 2.0 Type Library (for InfoPath 2007 only)|Microsoft.Office.Interop.InfoPath.dll|
101+
|Microsoft InfoPath 2.0 Type Library (for InfoPath 2007 only)|[Microsoft.Office.Interop.InfoPath.dll](https://docs.microsoft.com/dotnet/api/microsoft.office.interop.infopath?view=infopath-form)|
87102
|Microsoft InfoPath XML Interop Assembly (for InfoPath 2007 only)|Microsoft.Office.Interop.InfoPath.Xml.dll|
88103
|Microsoft Office 14.0 Object Library (Office shared functionality)<br /><br /> Microsoft Office 15.0 Object Library (Office shared functionality)|office.dll|
89104
|Microsoft Office Outlook View Control (can be used in Web pages and applications to access your Inbox)|Microsoft.Office.Interop.OutlookViewCtl.dll|
90-
|Microsoft Outlook 14.0 Object Library<br /><br /> Microsoft Outlook 15.0 Object Library|Microsoft.Office.Interop.Outlook.dll|
105+
|Microsoft Outlook 14.0 Object Library<br /><br /> Microsoft Outlook 15.0 Object Library|[Microsoft.Office.Interop.Outlook.dll](https://docs.microsoft.com/dotnet/api/microsoft.office.interop.outlook?view=outlook-pia)|
91106
|Microsoft PowerPoint 14.0 Object Library<br /><br /> Microsoft PowerPoint 15.0 Object Library|Microsoft.Office.Interop.PowerPoint.dll|
92-
|Microsoft Project 14.0 Object Library<br /><br /> Microsoft Project 15.0 Object Library|Microsoft.Office.Interop.MSProject.dll|
107+
|Microsoft Project 14.0 Object Library<br /><br /> Microsoft Project 15.0 Object Library|[Microsoft.Office.Interop.MSProject.dll](https://docs.microsoft.com/dotnet/api/microsoft.office.interop.msproject?view=office-project-server)|
93108
|Microsoft Publisher 14.0 Object Library<br /><br /> Microsoft Publisher 15.0 Object Library|Microsoft.Office.Interop.Publisher.dll|
94109
|Microsoft SharePoint Designer 14.0 Web Object Reference Library|Microsoft.Office.Interop.SharePointDesigner.dll|
95110
|Microsoft SharePoint Designer 14.0 Page Object Reference Library|Microsoft.Office.Interop.SharePointDesignerPage.dll|
96111
|Microsoft Smart Tags 2.0 Type Library **Note:** Smart tags are deprecated in [!INCLUDE[Excel_14_short](../vsto/includes/excel-14-short-md.md)] and [!INCLUDE[Word_14_short](../vsto/includes/word-14-short-md.md)].|Microsoft.Office.Interop.SmartTag.dll|
97112
|Microsoft Visio 14.0 Type Library<br /><br /> Microsoft Visio 15.0 Type Library|Microsoft.Office.Interop.Visio.dll|
98113
|Microsoft Visio 14.0 Save As Web Type Library<br /><br /> Microsoft Visio 15.0 Save As Web Type Library|Microsoft.Office.Interop.Visio.SaveAsWeb.dll|
99114
|Microsoft Visio 14.0 Drawing Control Type Library<br /><br /> Microsoft Visio 15.0 Drawing Control Type Library|Microsoft.Office.Interop.VisOcx.dll|
100-
|Microsoft Word 14.0 Object Library<br /><br /> Microsoft Word 15.0 Object Library|Microsoft.Office.Interop.Word.dll|
115+
|Microsoft Word 14.0 Object Library<br /><br /> Microsoft Word 15.0 Object Library|[Microsoft.Office.Interop.Word.dll](https://docs.microsoft.com/dotnet/api/microsoft.office.interop.word?view=word-pia)|
101116
|Microsoft Visual Basic for Applications Extensibility 5.3|Microsoft.Vbe.Interop.dll|
102117

103118
### Binding redirect assemblies
104-
When you install and register the Office PIAs in the global assembly cache (either with Office or by installing the redistributable package for the PIAs), the binding redirect assemblies are also installed only in the global assembly cache. These assemblies help make sure that the correct version of the primary interop assemblies is loaded at runtime. For example, when a solution that references a [!INCLUDE[office14_long](../vsto/includes/office14-long-md.md)] assembly runs on a computer that has the [!INCLUDE[Office_15_short](../vsto/includes/office-15-short-md.md)] version of the same primary interop assembly, the binding redirect assembly instructs the [!INCLUDE[dnprdnshort](../sharepoint/includes/dnprdnshort-md.md)] runtime to load the [!INCLUDE[Office_15_short](../vsto/includes/office-15-short-md.md)] version of the primary interop assembly. For more information, see [How to: Enable and disable automatic binding redirection](/dotnet/framework/configure-apps/how-to-enable-and-disable-automatic-binding-redirection).
119+
120+
When you install and register the Office PIAs in the global assembly cache (either with Office or by installing the redistributable package for the PIAs), the binding redirect assemblies are also installed only in the global assembly cache. These assemblies help make sure that the correct version of the primary interop assemblies is loaded at runtime.
121+
122+
For example, when a solution that references a [!INCLUDE[office14_long](../vsto/includes/office14-long-md.md)] assembly runs on a computer that has the [!INCLUDE[Office_15_short](../vsto/includes/office-15-short-md.md)] version of the same primary interop assembly, the binding redirect assembly instructs the [!INCLUDE[dnprdnshort](../sharepoint/includes/dnprdnshort-md.md)] runtime to load the [!INCLUDE[Office_15_short](../vsto/includes/office-15-short-md.md)] version of the primary interop assembly.
123+
124+
For more information, see [How to: Enable and disable automatic binding redirection](/dotnet/framework/configure-apps/how-to-enable-and-disable-automatic-binding-redirection).
105125

106126
## See also
107-
[How to: Target Office applications through primary interop assemblies](../vsto/how-to-target-office-applications-through-primary-interop-assemblies.md)
108-
[Excel object model overview](../vsto/excel-object-model-overview.md)
109-
[InfoPath solutions](../vsto/infopath-solutions.md)
110-
[Outlook object model overview](../vsto/outlook-object-model-overview.md)
111-
[PowerPoint solutions](../vsto/powerpoint-solutions.md)
112-
[Project solutions](../vsto/project-solutions.md)
113-
[Visio object model overview](../vsto/visio-object-model-overview.md)
114-
[Word object model overview](../vsto/word-object-model-overview.md)
115-
[General reference &#40;Office development in Visual Studio&#41;](../vsto/general-reference-office-development-in-visual-studio.md)
116-
117-
127+
128+
- [How to: Target Office applications through primary interop assemblies](../vsto/how-to-target-office-applications-through-primary-interop-assemblies.md)
129+
- [Excel object model overview](../vsto/excel-object-model-overview.md)
130+
- [InfoPath solutions](../vsto/infopath-solutions.md)
131+
- [Outlook object model overview](../vsto/outlook-object-model-overview.md)
132+
- [PowerPoint solutions](../vsto/powerpoint-solutions.md)
133+
- [Project solutions](../vsto/project-solutions.md)
134+
- [Visio object model overview](../vsto/visio-object-model-overview.md)
135+
- [Word object model overview](../vsto/word-object-model-overview.md)
136+
- [General reference &#40;Office development in Visual Studio&#41;](../vsto/general-reference-office-development-in-visual-studio.md)
137+
138+

0 commit comments

Comments
 (0)