SubTextParts have been introduced in version X13 (23.0) as a new document element to realize the new MailMerge merge block concept. But this feature can be used for many other tasks as well.

In general, a SubTextPart is a defined range of text with a Start, a Length and a Name. This name can be used to tag a SubTextPart to be protected. If the user enters this SubTextPart, the editMode property can be used to set TextControl to read only.

Version X14 (24.0) implements new events for the HTML5-based TextControl TXTextControl.Web: subTextPartEntered and subTextPartLeft. Both events return the event argument SubTextPartEventArgs object.

On leaving the SubTextPart, the subTextPartLeft event is used to switch back to edit mode.

The following JavaScript code shows this easy implementation: