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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

spell check while typing a work

Status
Not open for further replies.

maggielea

Programmer
Jun 19, 2007
6
US
I need to be able to spell check a single textbox while the user is typing. (exactly like spell check in word). I've found the acCmdSpelling command but it seems to only want to check spelling for what's there (not what's being typed). Also, when it is finished, it starts over at the first textbox of the first record. I only need to check the spelling on the current active textbox while someone is typing.
Thanks in advance.
 
You do not mention what application you are asking about. You do not mention what kind of textbox, although it may be a textbox on a userform. Is it?

You mention "the acCmdSpelling command". I am not sure what that is, it sounds kind of Access like.

As for what you are asking, I do not see that you could use any other event other than Textbox1_Change (or whatever is its name).

_Change fires with any change in the control. Other than that, this may not be possible, but certainly _Change will fire with each and every change. That is, say the user is typing in "This is sume text" (there is an error there...):

type "T" and _Change will fire.
type "h" and _Change will fire.
type "i" and _Change will fire.
type "s" and _Change will fire.
type " " and _Change will fire.
type "i" and _Change will fire.
type "s" and _Change will fire.
type " " and _Change will fire.
type "s" and _Change will fire.
type "u" and _Change will fire.
type "m" and _Change will fire.
type "e" and _Change will fire.
...etc

So you could put a spell check instruction into _Change that would take the existing content as check it.

HOWEVER, this seems outrageously inefficient.

type "T" and _Change will fire, checking "T"
type "h" and _Change will fire, checking "Th"
type "i" and _Change will fire, checking "Thi"
type "s" and _Change will fire, checking "This"
type " " and _Change will fire, checking "This "
type "i" and _Change will fire, checking "This i"
type "s" and _Change will fire, checking "This is"
type " " and _Change will fire, checking "This is "
type "s" and _Change will fire, checking "This is s"
type "u" and _Change will fire, checking "This is su"
type "m" and _Change will fire, checking "This is sum"
type "e" and _Change will fire, checking "This is sume"

...and bingo...an error can be detected.

An awful lot of processing, and you would have to build impeccable logic to be able to know "This is s" is NOT an error; "This is sum" is NOT an error...but "This is sume" is an error.

Unless someone can suggest something else, there seems, IMO, no real percentage in doing all that work.


faq219-2884

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top