Cannot find Microsoft.Office.Interop Visual Studio

后端 未结 10 1584
清酒与你
清酒与你 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: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.

提交回复
热议问题