Invoking autocorrect from textbox on a userform 
Author Message
 Invoking autocorrect from textbox on a userform

Does anyone know a good way to invoke autocorrect with the
spacebar from a textbox on a userform?


Tue, 25 May 2004 04:27:21 GMT  
 Invoking autocorrect from textbox on a userform
Hi Tom,

Quote:
> Does anyone know a good way to invoke autocorrect with the
> spacebar from a textbox on a userform?

AutoCorrect won't work in a UserForm, only in a Word
document, in the Word environment (or Excel, or Powerpoint -
a UserForm is something different).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :-)



Fri, 11 Jun 2004 00:47:43 GMT  
 Invoking autocorrect from textbox on a userform

Quote:

>Does anyone know a good way to invoke autocorrect with the
>spacebar from a textbox on a userform?

Only by writing code. In the textbox's KeyPress event procedure (or
the form's),

1) Detect when the spacebar is pressed (or any of the other keys that
can activate autocorrect).

2) Identify the last "word" the user typed (by working back through
the last characters in the textbox's Text property) and put it into a
variable (e.g. strLastWord).

3) find out if there's an AutoCorrect entry defined for that "word",
and if so retrieve the "correct" value, along these lines (perhaps
with additional error-handling code):

  On Error Resume Next
  varReplacement = AutoCorrect.Entries(strLastWord).Value
  On Error GoTo 0

4) Finally, something like this:
  If not IsNothing(varReplacement) Then
    'manipulate the textbox's Text property to make the actual
    'substitution
  End If

John Nurick [Access MVP]

Please do not respond by email, but to the newgroup.



Sat, 12 Jun 2004 13:29:52 GMT  
 Invoking autocorrect from textbox on a userform
Posting in the newsgroups on Christmas day? You *are* {*filter*}ed! <g> Hope you
had a good Christmas and New Year. Your suggestion is neat, too (although
I'd have expected to slow down typing in the UserForm noticably, for the
user - maybe I'm wrong about that?).

Regards

Dave


Quote:
>Does anyone know a good way to invoke autocorrect with the
>spacebar from a textbox on a userform?

Only by writing code. In the textbox's KeyPress event procedure (or
the form's),

1) Detect when the spacebar is pressed (or any of the other keys that
can activate autocorrect).

2) Identify the last "word" the user typed (by working back through
the last characters in the textbox's Text property) and put it into a
variable (e.g. strLastWord).

3) find out if there's an AutoCorrect entry defined for that "word",
and if so retrieve the "correct" value, along these lines (perhaps
with additional error-handling code):

  On Error Resume Next
  varReplacement = AutoCorrect.Entries(strLastWord).Value
  On Error GoTo 0

4) Finally, something like this:
  If not IsNothing(varReplacement) Then
    'manipulate the textbox's Text property to make the actual
    'substitution
  End If

John Nurick [Access MVP]

Please do not respond by email, but to the newgroup.



Wed, 23 Jun 2004 14:34:42 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Invoking autocorrect in a textbox on a userform.

2. Userform: populate textbox with date from another textbox

3. Invoking a UserForm from a Word Document

4. Basic (!) userform query - greying out of textboxes

5. datetimeformat in userform.textbox

6. UserForms, Textboxes & Bookmarks

7. Userforms - populating textboxes

8. Greying out textboxes in a userform

9. Focus and textboxes on vba userforms

10. Looping thru Textboxes in Userform

11. Unloading an array to TextBoxes on a UserForm

12. Help with userform/textbox

 

 
Powered by phpBB® Forum Software