Cannot find Microsoft.Office.Interop Visual Studio

后端 未结 10 1480
清酒与你
清酒与你 2020-11-28 09:25

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 thing

相关标签:
10条回答
  • 2020-11-28 09:25

    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 does not find what you need:

    using Microsoft.Office.Interop.Outlook;
    

    enter image description here

    0 讨论(0)
  • 2020-11-28 09:26

    You need to install Visual Studio Tools for Office Runtime Redistributable:

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

    0 讨论(0)
  • 2020-11-28 09:28

    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

    0 讨论(0)
  • 2020-11-28 09:28

    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.

    0 讨论(0)
  • 2020-11-28 09:34

    If you're using Visual Studio 2015 and you're encountering this problem, you can install MS Office Developer Tools for VS2015 here.

    0 讨论(0)
  • 2020-11-28 09:39

    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 "Microsoft Office Developer Tools"
    4. Start Update

    It should work now.

    0 讨论(0)
提交回复
热议问题