Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 106
  • Last Modified:

non-Dictionary word

Hi,

could you please help me the bellow questions......

How to get non-dictionary word from a word document programmatically?

and check the string is dictionary word or non-dictionary word ?
0
mannevenu26
Asked:
mannevenu26
1 Solution
 
Rgonzo1971Commented:
Hi,

pls try

using System;
using Word =  Microsoft.Office.Interop.Word;

class Program
{
    static void Main()
    {



        int myErrors = 0;
        // Open a doc file.
        object oMissing = System.Reflection.Missing.Value;
        Word.Application application = new Word.Application();

        application.Visible = true;
        Word.Document document = application.Documents.Open("c:\\YourFile.docx");

        foreach (Word.Range wd in document.Words)
        {
            myErrors = wd.SpellingErrors.Count;
            if (myErrors > 0)
            {
                Console.WriteLine("{0} is not in the spelling Dic ", wd.Text);
            }

        }

        application.Quit();
    }
}

Open in new window

Regards
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now