First, remember that Patience is a Virtue. Second, I read your question an hour ago and just kept going. You tell us you want to insert text but you don't tell us what you are inserting to. A String? A Text area? You need to Tell the Details.
Have a look at the documentation for HTMLDocument, and its superclass, Document. HTMLDocument is a tree structure built from HTML source comprised of Element instances (i.e. HTML, HEAD, BODY) which contain other Elements (i.e. H3, P, plain text). You should be able to programmatically determine where the cursor is within the document and manipulate the Element instances to introduce new tags and text.
Joined: Aug 21, 2004
I have already read those api documents but I don't understand it anyway. I guess i'll have to try ones more.