Word VBA: Where is the insertion point in a Textbox?

I have a textbox and need to know the current location of the insertion point in the text so that I can check the character to the immediate left of the insertion point. I will be getting this information inside a KeyPress Sub. If possible, I would like to know the location as the number of characters between the current location and the start of the text.
Thanks for any help.
JRA
JohnRobinAllenRetired professor of FrenchAsked:
Who is Participating?
 
GrahamSkanRetiredCommented:
There is a SelStart property that tells you where the beginning of the selection is. You might also find the SelLength and the SelText properties useful.
0
 
JohnRobinAllenRetired professor of FrenchAuthor Commented:
The answer came so quickly that I have not had a chance to test it. However, since it comes from Graham Skan, I know that the solution will be correct.
    Many thanks
    JRA
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.