Link to home
Start Free TrialLog in
Avatar of BASESLydia
BASESLydia

asked on

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.
ASKER CERTIFIED SOLUTION
Avatar of weddell
weddell

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of arif_eqbal
arif_eqbal

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

Avatar of BASESLydia

ASKER

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