• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 565
  • Last Modified:

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

I could use an example of how to use the microsoft office interop word dll to check spelling from a .NET application.
0
BASESLydia
Asked:
BASESLydia
1 Solution
 
weddellCommented:
Hi, these two articles describe how to develop your own spell checker using the Word spelling engine...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnofftalk/html/office10032002.asp

http://www.devcity.net/net/article.aspx?alias=spellcheck

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)
0
 
arif_eqbalCommented:
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
        Wd.Documents.Add()
        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
        Next
        Wd.ActiveDocument.Close()
        Wd.Quit()
        Wd = Nothing

0
 
BASESLydiaAuthor Commented:
The second article http://www.devcity.net/net/article.aspx?alias=spellcheck
had a good example I was able to adapt for my needs.

Thanks for everyone's help
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

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