Has anyone used the Microsoft Word Interop to check spelling from a .NET app?

Posted on 2004-11-22
Last Modified: 2012-06-27
I could use an example of how to use the microsoft office interop word dll to check spelling from a .NET application.
Question by:BASESLydia
    LVL 3

    Accepted Solution

    Hi, these two articles describe how to develop your own spell checker using the Word spelling engine...

    However, I know there is a sample in the Visual Studio samples that I used not long ago. Basically, the code created a new Word document, opened it, changed some test, performed a spell check and corrected them automatically then closed the word document... displaying prompts all the way through it, ie. Creating new document..

    It was a console application.

    Have a look through your samples, search for (obviously) word interop - I tried having a look on msdn for you but couldn't find it... I know it's there (I think it was 2002 version though, not 2003)
    LVL 19

    Expert Comment

    try this out
    I have tried to check the spelkling of data in a TextBox on the form

    Dim Wd As Word.Application
            Wd = New Word.Application
            Dim SP As Word.SpellingSuggestions
            Dim i As Integer
            Dim Words() As String
            Words = TextBox1.Text.Split(" ")
            For i = 0 To Words.Length - 1
                SP = Wd.GetSpellingSuggestions(Words(i))
                If SP.Count > 0 Then
                    MessageBox.Show(String.Format("Replace {0} with {1}", Words(i), SP.Item(1).Name))
                 'Get confirmation from user and Replace or Automatically replace as you like...
                End If
            Wd = Nothing

    LVL 1

    Author Comment

    The second article
    had a good example I was able to adapt for my needs.

    Thanks for everyone's help

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Suggested Solutions

    Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
    This is about my first experience with programming Arduino.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now