What you can do is watch for when the user types a space, and that would indicate that the word preceeding the cursor should be checked for coloring. When opening a document you would have to loop through the text. Depending on the specifics, you may be tweeking the code for awhile to get it to work.