Missing Microsoft.Office.Interop namespace

Hello,

I have recently been using VB.NET 2005 Express to update code written in VB6. I have been able to migrate everything needed so far with the exception of a block of code which writes a text string to an MS Office Word document.

I have followed all the advice I could find on installing the Microsoft Office Object library 11.0 (Office 2003) as a reference to my project. I am then able to add the Microsoft.Office.Core namespace to my project but I am still unable to reference any of the interop namespaces. (e.g. Microsoft.Office.Interop.Word) so I cannot open Word programmatically and write my text string to it.

Imports Microsoft.Office.Interop.Word

This line gets the green squigglys and says: "Namespace or type specified in the Imports 'Microsoft.Office.Interop.word' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

I have made sure that the .Net Programmability Support options in Office are installed and I know for sure that the Microsoft Office Object Library 11.0 is referenced.

Has anyone else experienced this problem If so, is there anyway to add the interop namespaces separately from the Microsoft.Office.Core namespace Any help you can give me will be greatly appreciated.

-Jason E.



Answer this question

Missing Microsoft.Office.Interop namespace

  • bobe59

    Just figured it out!

    There is another reference that showed up in my project properties list named Microsoft Word 11.0 Object Library. It has all the interop namespaces and now I can continue with my project. Thanks for your help!

    Jason E.


  • Peter B.L. Rasmussen

    Spotty,

    Thanks for your help. I have previously followed that link and installed the .NET interop assemblies for Office just as that article stated. The items it recommends are installed to "run from my computer" (with the exception of Outlook 2003, which isn't installed on my machine) However, I am STILL not able to see the interop namespaces in my project!

    I am amazed at how easy the inclusion of Office was in VB6 compared to the trouble I am having with VB.NET Express. Is there any specific order to these tasks (Do I have to install the interops first and then reinstall VB.NET 2005 Express ) Should I I even have to reinstall it at all I would assume by just adding the reference to the Office 11.0 Object library in my project properties that these would be available to me, but all I get to use is Microsoft.Office and Microsoft.Office.Core.

    Jason E.


  • gb99

  • Missing Microsoft.Office.Interop namespace