3

I am writing a c# code for spellchecking using Word.dll. I have used the following site as reference: http://www.codeproject.com/Articles/2469/SpellCheck-net-spell-checking-parsing-using-C

But i am getting an error: "The type or namespace name 'Word' could not be found (are you missing a using directive or an assembly reference?)"

The code that I am using is:

    SpellCheck word = new SpellCheck();

    bool status = false;
    string s = "youes";

    Console.WriteLine("Checking for word : " + s );

    // check to see if the word is not correct  
    // return the bool (true|false)
    status = word.CheckSpelling(s);

    if (status == false)
    {
        Console.WriteLine("This word is misspelled : " + s);
        Console.WriteLine("Here are some suggestions");
        Console.WriteLine("-------------------------");

        foreach( string suggestion in word.GetSpellingSuggestions(s) ) 
        {
            System.Console.WriteLine( suggestion ); 
        }
    }
    else if (status == true)
    {
        Console.WriteLine("This word is correct : " + s );
    }

I just want to know how can I make it work?

1
  • using Word; is this on top of your code? Commented Feb 27, 2012 at 9:47

3 Answers 3

1

Create a new class in your solution and call it Word.cs. Open the “Browse Code” tab in the article at CodeProject, click Word.cs to view it's source code. Copy and paste it to your Word.cs file.

Sign up to request clarification or add additional context in comments.

Comments

1

You should download the source code. There is a file named Word.cs, and you should add that file to your project. Word namespace and SpellCheck class are defined in that file.

Comments

0

I think you should add refernce to Micorsoft.Office.Interop.Word under .Net

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.