Cannot find Microsoft.Office.Interop Visual Studio
C#.NetC# Problem Overview
I am developing an application which will send emails using C#. The app will be able to use templates for mail, among other things. The problem is I'm having trouble finding any Office.Interop references, which means I cannot work with Outlook.
Office is installed on my computer, but I've also tried to install the PIA from this link http://www.microsoft.com/en-us/download/details.aspx?id=3508. Unfortunately, this didn't change anything: When I launch the MSI it stops without a word, and I don't know if that is part of the problem.
C# Solutions
Solution 1 - C#
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.:
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;
Solution 2 - C#
I forgot to select Microsoft Office Developer Tools for installation initially. In my case Visual Studio Professional 2013 and also 2015.
Solution 3 - C#
If you're using Visual Studio 2015 and you're encountering this problem, you can install MS Office Developer Tools for VS2015 here.
Solution 4 - C#
With Visual Studio 2015 I have activated it with the following steps.
- Programs and Features --> Select Visual Studio > Change
- Choose Modify
- Windows and Webdevelopment --> Tick/select "Microsoft Office Developer Tools"
- Start Update
It should work now.
Solution 5 - C#
You can find it at link:
> C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Word\15.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Word.dll
Browse it then add references
Solution 6 - C#
If you have installed latest Visual studio and want to
To locate library of Microsoft.Office.Interop.Outlook
or any other Microsoft.Office.Interop
library then you should look into below 2 folders:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office14
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office15
Please note that folder could be C:\Program Files\
Solution 7 - C#
I think you need to run that .msi to install the dlls. After I ran that .msi I can go to (VS 2012) Add References > Assemblies > Extensions and all of the Microsoft.Office.Interop dlls are there.
On my computer the dlls are found in "c:\Program Files(x86)\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA" so you could check in a similar/equivalent directory on yours just to make sure they're not there?
Solution 8 - C#
You need to install Visual Studio Tools for Office Runtime Redistributable:
Solution 9 - C#
I had the same issue with Visual Studio Community 2013, I fixed it downloading and installing the latest update of Office Developer Tools for Visual Studio 2013. Now I am able to see the whole Microsoft.Office.Interop.* list when I go to > Add References > Assemblies > Extensions
you can download it from here:
https://www.visualstudio.com/en-us/news/vs2013-update4-rtm-vs.aspx#Office
http://aka.ms/OfficeDevToolsForVS2013
Solution 10 - C#
Just doing like @Kjartan.
Steps are as follows:
-
Right click your C# project name in Visual Studio's "Solution Explorer";
-
Then, select "add -> Reference -> COM -> Type Libraries " in order;
-
Find the "Microsoft Office 16.0 Object Library", and add it to reference (Note: the version number may vary with the OFFICE you have installed);
-
After doing this, you will see "Microsoft.Office.Interop.Word" under the "Reference" item in your project.