Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does anyone know how I can add a dictionary/spell checker to project??

Status
Not open for further replies.

docmeizie

Programmer
Aug 5, 2003
326
US
Well here is the situation, I am looking to create a program that produces all the words that are possible from from a certain set of letters that I input. What the program will do also is have 7,8,9 textboxes that I will be able to put in letters in there corresponding place and then do a search for words that way. I have my design down already, I just need to find a way to connect the MS Office Dictionary / Spell Checker so that I may generate all the words I can use. Any help or insight would be greatly appreciated.

If I take a peek in your Windows, to fix a problem, does that make me a "Peeping Tom"? Hmmmmmmmmmmv [pc1][shocked]
 
If the PC's you are loading the application has microsoft WORD you can use the following code.

Public Function SpellCheck(strText As String, Optional blnSupressMsg As Boolean = False) As String
'This function opens the MS Word Object
' and uses its spell checker
'passing back the corrected string
On Error Resume Next
Dim oWDBasic As Object
Dim sTmpString As String


If strText = "" Then
If blnSupressMsg = False Then
MsgBox "Nothing To spell check.", vbInformation, App.ProductName
End If
Exit Function
End If
Screen.MousePointer = vbHourglass
Set oWDBasic = CreateObject("Word.Basic")

With oWDBasic
.FileNew
.Insert strText
.ToolsSpelling oWDBasic.EditSelectAll
.SetDocumentVar "MyVar", oWDBasic.Selection
End With
sTmpString = oWDBasic.GetDocumentVar("MyVar")
sTmpString = Left(sTmpString, Len(sTmpString) - 1)


If sTmpString = "" Then
SpellCheck = strText
Else
SpellCheck = sTmpString
End If
oWDBasic.FileCloseAll 2
oWDBasic.AppClose
Set oWDBasic = Nothing
Screen.MousePointer = vbNormal

SpellCheck = Replace(SpellCheck, Chr(10), Chr(32))
' SpellCheck = Replace(SpellCheck, Chr(8), Chr(32))
' SpellCheck = Replace(SpellCheck, Chr(9), Chr(32))

SpellCheck = Replace(SpellCheck, Chr(13), Chr(13) + Chr(10))

' If blnSupressMsg = False Then
' MsgBox "Spell check is completed.", vbInformation, App.ProductName
' End If

End Function
 
Okay that is a good start, one question I have about this function is will it produce all possible words so that I can put the words into listboxes. The listboxes will be indicative of the length of the words. I.e.: 3 letter words, 4 letter words, five letter words, six letter words, so an and so forth.

If I take a peek in your Windows, to fix a problem, does that make me a "Peeping Tom"? Hmmmmmmmmmmv [pc1][shocked]
 
I am not sure. The only thing I have used it for is to do spellchecking on multiline textboxes where the user puts in comments or notes. It will walk you thru the string you pass it and gives you suggestions on corrections just like WORD. Hope this helps.
 
Okay this should get me started in the right direction at least. Thanks!

If I take a peek in your Windows, to fix a problem, does that make me a "Peeping Tom"? Hmmmmmmmmmmv [pc1][shocked]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top