.NET Spell checker available?

G

Guest

Hello All:

Does anyone know of a spell checker that works with .NET?

Any options will be welcome.

TIA,
 
C

CMM

Do you mean free? I think the ComponentOne tools that MS put in the VB 2003
Resource came with a free SpellChecker component. Not sure if that's still
available... it has been a while since the resource kit came out.

You can also enlist Word to do spellchecking for you.... check this out....
it seems a bit kludgy at first, but it works quite well (for WinForms
anyway):

Option Strict Off

Public Class MSWordSpellChecker
Implements IDisposable

'Adapted from old VB6 code

Private m_oWord As Object
Private m_oWordDoc As Object
Private m_bInit As Boolean

Public Sub Init()

m_oWord = CreateObject("Word.Application")
m_oWordDoc = m_oWord.Documents.Add
m_oWord.Visible = False
m_oWord.WindowState = 2 'WdWindowState.wdWindowStateMinimize
m_bInit = True

End Sub

Public Sub SpellCheck(ByRef sText As String)

Dim iLen As Integer

If Not m_bInit Then Init()

m_oWord.Selection.WholeStory()
m_oWord.Selection.Text = sText
m_oWord.Selection.LanguageID = 1033 'WdLanguageID.wdEnglishUS

m_oWordDoc.CheckSpelling()

m_oWord.Selection.WholeStory()
sText = m_oWord.Selection.Text

' strip off CR/LF on end of string
iLen = Len(sText)
While (iLen > 0 And ((Right(sText, 1) = vbCr) Or (Right(sText, 1) =
vbLf)))
iLen -= 1
sText = Left(sText, iLen)
End While

m_oWord.Visible = False

End Sub

Public Sub SpellCheckClipboard()

If Not m_bInit Then Init()

m_oWord.Selection.WholeStory()
m_oWord.Selection.Paste()
m_oWord.Selection.LanguageID = 1033 'WdLanguageID.wdEnglishUS

m_oWordDoc.CheckSpelling()

System.Windows.Forms.Clipboard.SetDataObject(New
System.Windows.Forms.DataObject)

m_oWord.Selection.WholeStory()
m_oWord.Selection.Copy()

m_oWord.Visible = False

End Sub

Public Sub Dispose() Implements System.IDisposable.Dispose

Try
If Not m_oWordDoc Is Nothing Then
m_oWordDoc.Close(SaveChanges:=0)
'WdSaveOptions.wdDoNotSaveChanges
m_oWordDoc = Nothing
End If
If Not m_oWord Is Nothing Then
m_oWord.Quit()
m_oWord = Nothing
End If
Catch
'do nothing
End Try

End Sub

Protected Overrides Sub Finalize()

Dispose()
MyBase.Finalize()

End Sub

End Class
 
W

William Buchanan

I don't have any experience of using this in .NET (that's my disclaimer to
say that the following might be complete nonsense), but I have used Word
automation in the past, and the problem I had with this kind of thing is
that it *WILL NOT* work in a multi-threaded environment (such as ASP.NET
pages). The reason I highlight this fact is because it is actually
documented by MS that it is not designed to work in this way, and so should
not be used in this way. I discovered this after a couple of weeks of trial
and error.

It might be different for the spell checker and for .NET so don't just take
my word for it, but it might be worth looking at this before spending too
much time on it.

Will
 
G

Guest

Juan,

I *did* Google it and got the same responses that you did.

The point of the post was to ask seasoned professionals (and not search
engines) for suggestions. Based on my experience, many people here have used
these types of products and I wanted to avoid having to spend hours milling
through garbage to find one that really works well.

Never fear; I try to always Google before you hear from me.

So, have you sued any of the ones that you sited?

--
Joe


Juan T. Llibre said:
 
J

Juan T. Llibre

G

Guest

Juan,

Obviously I needed a spell-checker!

Let that last line read read, "Have you *used* any of the ones that you
sited?"

Thanks,
 
G

Guest

re:
No, but I have used a couple... ;-)

My typing is so bad sometimes, I need a usage-checker!

Thanks for the tips; these help. This is for a client. They'll pay for a
product that works well.

My best to you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top