Cannot find Microsoft.Office.Interop Visual Studio

C#.Net

C# 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.:

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

Solution 2 - C#

I forgot to select Microsoft Office Developer Tools for installation initially. In my case Visual Studio Professional 2013 and also 2015.

enter image description here

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.

  1. Programs and Features --> Select Visual Studio > Change
  2. Choose Modify
  3. Windows and Webdevelopment --> Tick/select "Microsoft Office Developer Tools"
  4. 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:

http://msdn.microsoft.com/en-us/library/ms178739.aspx

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:

  1. Right click your C# project name in Visual Studio's "Solution Explorer";

  2. Then, select "add -> Reference -> COM -> Type Libraries " in order;

  3. 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);

  4. After doing this, you will see "Microsoft.Office.Interop.Word" under the "Reference" item in your project.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionT2oView Question on Stackoverflow
Solution 1 - C#KjartanView Answer on Stackoverflow
Solution 2 - C#Matthew LockView Answer on Stackoverflow
Solution 3 - C#Phileo99View Answer on Stackoverflow
Solution 4 - C#LuckyLikeyView Answer on Stackoverflow
Solution 5 - C#Tung HaView Answer on Stackoverflow
Solution 6 - C#AmitView Answer on Stackoverflow
Solution 7 - C#John DarvillView Answer on Stackoverflow
Solution 8 - C#OscarView Answer on Stackoverflow
Solution 9 - C#joseluisccView Answer on Stackoverflow
Solution 10 - C#Chengshuang LiView Answer on Stackoverflow