HELP PLEASE - The type or namespace name'Office' does not exist in the namespace 'Microsoft'

Hi,

I have just followed through the example on the Microsoft web site at url:

http://support.microsoft.com/ kbid=316384

The code has not been altered from the example.


I now get the Error:

The type or namespace name'Office' does not exist in the namespace 'Microsoft'

I loaded the Microsoft Word Object Library from the COM tab the entry on my machine is Microsoft Word 9.0 Object library.

This successfully transfers the Interop.Office.dll, Interop.VBIDE.dll, Interop.VBRUN.dll and Interop.Word.dll files to the new project.

However the line

using Word = Microsoft.Office.Interop.Word;

returns the following error.

I tried adding other Microsoft.Office COM references and found that by adding a reference to:

Microsoft Office Web Components 11.0

gave me access to Microsoft.Office.Interop but that only gives a reference to Owc11

My version of word is 2000

What am I doing wrong Should I be Referencing something else because of the version of Word I am using

Thanks Andrew




Answer this question

HELP PLEASE - The type or namespace name'Office' does not exist in the namespace 'Microsoft'

  • Richard Greenberg

    Add reference to MS Office Word 11.0 Object...

    this will give you objects in Microsoft.Office.Interop.Word

    article says On the COM tab, locate Microsoft Word Object Library, and then click Select

    Hope this helps



  • HELP PLEASE - The type or namespace name'Office' does not exist in the namespace 'Microsoft'