שתף באמצעות


can't find microsoft.office.interop.word in Visual Studio reference

Question

Wednesday, September 12, 2018 9:20 AM

I have read a lot way to solve this problem, but still can't find it.

My pc is win10 & visual studio 2017.

I can find it in the C:\Windows\assembly. Does it means I have installed?

All replies (8)

Wednesday, September 12, 2018 5:46 PM ✅Answered | 2 votes

Did you install the Visual Studio Tools for Office?

- Wayne


Wednesday, September 12, 2018 9:38 AM

Hi,

.net 4.0 or later version added reference, if it is not 4.0 or above, there may not be this, you can download a Microsoft.Office.Interop.Word.dll by yourself.

In your project, right-click on "References" and select "Add" .

Imports Microsoft.Office.Interop.Word

Best Regards,

Alex

MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


Wednesday, September 12, 2018 10:02 AM

With VS 2015, Office 2016, I add the Object Library :


Wednesday, September 12, 2018 11:03 AM

There are times when an assembly will not show up and you need to browse for them. Browse under were the bold parts reflect which version of Office is installed.

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Visual Studio Tools for Office\PIA\Office15.

You can also add them to "Custom Component Set" in Object Browser (the default hot key is F2). Once added select that library and press the button where the arrow is indicating. 

I this for all the ones shown as I use them often.

Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
VB Forums - moderator


Wednesday, September 12, 2018 11:25 AM

HI,Alex-Li-MSFT

I check my project is .net4.5.2 , but I can't find the microsoft.office.interop.word in the VS assemblies.

Is it any possible that my office is o365 cause the problem?

Thanks for your reply.


Wednesday, September 12, 2018 11:40 AM

Hi, Casorix31

I have add this com already, but there are some code error.

I try to add a table in the document,but error shows tables are not the member of document.

I search this problem and they tell me I need to add microsoft.office.interop.word first.

Thanks for your reply.


Thursday, September 13, 2018 2:50 AM

Hi, WayneAKing

Thanks for your help, I finally find it.


Thursday, September 13, 2018 3:05 AM

Hi,

I am glad you have got your solution, we appreciated you shared us your solution and mark it as an answer.

Best Regards,

Alex

MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.