Contents - Index - Previous - Next


ToggleItalic method




Declaration
function ToggleItalic(UseCurrentWord: Boolean = True): Boolean;

Description

Toggles the italic 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 <EM> and </EM> tags around the selection or at the insertion point. If the selection is already formatted italic, the <EM> and </EM> tags are removed. If the selection is within a larger string of italic text, the method inserts </EM> and <EM> tags around the selection, effectively turning italics off 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 italics.