Contents
- Index
- Previous
- Next
ToggleUnderline method
Declaration
function ToggleUnderline(UseCurrentWord: Boolean = True): Boolean;
Description
Toggles the underline state of the selected text.
If the optional parameter UseCurrentWord is True (the default) then, if nothing is selected but the insertion point is within a word, the method treats the current word as the selection.
The method places <U> and </U> tags around the selection or at the insertion point. If the selection is already underlined, the <U> and </U> tags are removed. If the selection is within a larger string of underlined text, the method inserts </U> and <U> tags around the selection, effectively removing underlining for the selection.
Returns True on success. Returns False if the selection is an element (such as a control or table) that does not support underlining.