Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Spell Checking a String


I'd like to be able to spell check the text a user has entered in a RTF-Text
box within an excel form. If I was working in MS-Word I would just use the
getSpellingSuggestions() function to check each word in the RTFTextbox.Text
string.

Unfortunately I can't even create a Word application object

ie. CreateObject(€śWord.Application€ť)

because the system doesn't have Word installed on it, only Excel. Does Excel
have a similar function in it, or is there some other office library I can
import that does?

- Rm

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Spell Checking a String

Robert,

Try the macro below, which requires that the activesheet not be protected.

HTH,
Bernie
MS Excel MVP

Sub Macro1()
CheckMySpelling Application.InputBox( _
"Give me an input that might be misspelled")
End Sub

Sub CheckMySpelling(strTestWrong As String)
Dim strTestCorrect As String
Dim myWords As Variant
Dim i As Integer
Dim myCell As Range

myWords = Split(strTestWrong, " ")
For i = LBound(myWords) To UBound(myWords)
If Not Application.CheckSpelling(myWords(i)) Then
GoTo CorrectSpelling
End If
Next i
MsgBox """" & strTestWrong & """ was correctly spelled."
Exit Sub

CorrectSpelling:

Application.ScreenUpdating = False
Set myCell = Range("A65536").End(xlUp)(2)
myCell.Value = strTestWrong
myCell.CheckSpelling
strTestCorrect = myCell.Value
myCell.Clear
MsgBox strTestWrong & Chr(10) & "was corrected to be " & _
Chr(10) & strTestCorrect
Application.ScreenUpdating = True

End Sub


"Robert Mulroney" '''' wrote in message
...

I'd like to be able to spell check the text a user has entered in a RTF-Text
box within an excel form. If I was working in MS-Word I would just use the
getSpellingSuggestions() function to check each word in the RTFTextbox.Text
string.

Unfortunately I can't even create a Word application object

ie. CreateObject("Word.Application")

because the system doesn't have Word installed on it, only Excel. Does Excel
have a similar function in it, or is there some other office library I can
import that does?

- Rm



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spell Checking with checking cell notes jfitzpat Excel Discussion (Misc queries) 0 August 8th 07 10:26 PM
spell checking options dvs_47 Excel Worksheet Functions 2 March 6th 06 09:16 PM
Spell Checking a text box. c Excel Programming 2 February 28th 05 11:45 PM
Spell Checking Text Boxes? Don Wiss Excel Programming 2 December 26th 04 11:32 PM


All times are GMT +1. The time now is 05:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"