Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find Microsoft.Office.Interop Visual Studio

Tags:

c#

.net

I need to develop an application which will has the capability to send emails using C# with visual studio. The app will be able to use templates for mail, and a lot of things, but I have a problem.

I cannot find any Office.Interop references when I try to add them, which is mean I cannot work with Outlook. Office is installed on my computer, but i also try to install the PIA from this link http://www.microsoft.com/en-us/download/details.aspx?id=3508 but it didn't change anything (when I launch the MSI it stops without a word, I don't know if it's part of the problem).

I`m using Visual Studio 2013 Express, in case that might limit the possible answers.

like image 962
T2o Avatar asked Feb 24 '14 11:02

T2o


People also ask

How do I install Microsoft Office Primary Interop Assemblies?

To install the Office 2010 Primary Interop Assemblies, click the Download button, then click Save and select a location for PIARedist.exe on your computer. Run the executable to extract the O2010pia. msi file. Use one of the following installation methods to install O2010pia.

How do I use Microsoft Office Interop Excel in .NET core?

First, Remove 'Microsoft. Office. Interop. Excel' nuget package, and then add reference to 'Microsoft Excel 16.0 Object Library' (right click the project -> 'Add' -> 'Reference' -> search and add 'Microsoft Excel 16.0 Object Library' ).


1 Answers

Look for them under COM when trying to add the references. You should find the reference below, and possibly Microsoft Outlook 15.0 Object Library, if you need that. There are similar libraries for Word, Excel, etc.:

enter image description here

Update: The Object Library should contain the Interop stuff. Try to add this to a source file and see if it can now find what you need:

using Microsoft.Office.Interop.Outlook; 

enter image description here

like image 78
Kjartan Avatar answered Oct 12 '22 20:10

Kjartan