Make a Spell Checker
Spell checking has always been one of MS Word's greatest features, but now you to can include spell checking into your application with out increasing your file size.
This great example demonstrates how you can setup a spell check by opening Word, copying and pasting the text, spell check it and then close down Word.
Private Function FN_SpellCheck(strTextToVerify As String) _
As Boolean
On Error GoTo FN_SpellCheckErr
Dim oWord As Object
Dim strSelection As String
Set oWord = CreateObject("Word.Basic")
With oWord
.AppMinimize
.FileNewDefault
.EditSelectAll
' done immediately before to minimize possibility of
' user interaction with the clipboard
Clipboard.SetText strTextToVerify, vbCFRTF
.EditPaste
.StartOfDocument
On Error Resume Next
.ToolsSpelling
On Error GoTo 0
.EditSelectAll
.EditCOPY
strSelection = Clipboard.GetText(vbCFRTF)
If Mid(strSelection, Len(strSelection), 1) = Chr(13) Then
strSelection = Mid(strSelection, 1, Len(strSelection) - 1)
End If
If Len(strSelection) > 1 Then
strTextToVerify = strSelection
FN_SpellCheck = True
End If
.FileCloseAll 2
.AppClose
End With
Set oWord = Nothing
Exit Function
0 Comments (click to add your comment)
Networking Solutions
More for Developers
On the Codeguru Forums
Visit the Forums »Featured Partner Resources
Get your Android Apps ready for Intel® Atom™ processor-based smartphones and tablets now.
Use the Android NDK to deliver the best performance on Intel® Atom™ processor-based devices.
The Android community on the Intel® Software Network has everything you need to prepare your apps for Intel® Atom™ processor-based devices.



Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.