AncientTiger
Programmer
Ok, I've researched it and found a method for using a Word process to spellcheck a textboxes contents, however no matter what I try I just CANNOT get it to ignore the letter case. If it's typed in all lowercase, then it works fine, but uppercase it missing spelling errors altogether.
I'm just not that familiar with the methodology and syntax for this, if someone could point me in the right direction?
I also am having an issue with the spelling error window not popping up, but rather staying behind everything else. I have to Alt-Tab to activate it. I've tried appactivate with the "Spelling" title of that screen, but to no avail. Maybe a tip on how to remedy that as well?
Here's the routine that checks the text:
I've attached the sample project that has the issues listed.
Thanks in advance for all your help
------------------------------------
Over 30 years of programming, and still learning every day!
I'm just not that familiar with the methodology and syntax for this, if someone could point me in the right direction?
I also am having an issue with the spelling error window not popping up, but rather staying behind everything else. I have to Alt-Tab to activate it. I've tried appactivate with the "Spelling" title of that screen, but to no avail. Maybe a tip on how to remedy that as well?
Here's the routine that checks the text:
Code:
Public Sub SPELLCHECKER(ByVal FF As Variant)
Dim objWord As Object
Dim objDoc As Object
Dim strResult As String
'Create a new instance of word Application
Set objWord = CreateObject("word.Application")
Set objDoc = objWord.Documents.Add(, , 1, True)
objDoc.Content = FF.Text
objDoc.CheckSpelling , , , True
objWord.Visible = False
strResult = Left(objDoc.Content, Len(objDoc.Content) - 1)
' Correct the carriage returns
strResult = Replace(strResult, Chr(13), Chr(13) & Chr(10))
If FF.Text = strResult Then
' There were no spelling errors, so give the user a
' visual signal that something happened
MsgBox "The spelling check is complete.", vbInformation + vbOKOnly
End If
'Clean up
objDoc.Close False
Set objDoc = Nothing
objWord.Application.Quit True
Set objWord = Nothing
' Replace the selected text with the corrected text. It's important that
' this be done after the "Clean Up" because otherwise there are problems
' with the screen not repainting
FF.Text = strResult
End Sub
I've attached the sample project that has the issues listed.
Thanks in advance for all your help
------------------------------------
Over 30 years of programming, and still learning every day!