Can't locate Microsoft.Office.Interop.Word in Reference List

故事扮演 提交于 2019-11-28 08:16:21

you might need to install the assemblies separately,if you did not choose to install them during your office installation.

MSDN:

You must install the Microsoft Office primary interop assemblies (PIAs) in the global assembly cache of your development computer before you can perform certain development tasks. Typically, the PIAs are installed automatically when you install Office on the development computer. However, in some cases you might need to install the PIAs separately.

More here

You need Microsoft Word xx Object Library.

You can download the Primary Interop Assemblies from here.

http://www.microsoft.com/en-us/download/details.aspx?id=3508

You may also use NuGet Package Manager in order to install the reference. Go to Project -> Manage NuGet Packages... Search for "Interop.Word" and install that package.

Good thing about it is that you don't need to think about where the dll is located. When another person will check out the solution, NuGet will get all needed packages onto their machine.

Check if the library (Microsoft.Office.Interop.word) is present in the assembly folder of windows (C:\Windows\assembly) else you can install it from http://www.microsoft.com/en-us/download/details.aspx?id=3508

Now you just need locate it in your visual studio.

Right click on the consoleApplication(or name of you application) in SolutionExplorer window and

Go to Add -> References-> Browse and find C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.word or similar directory. press ok and your can now use the library in your application.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!