|Top Previous Next|
Applies the specified style template to the selected text or paragraphs.
procedure ApplyStyleTemplate(TemplateNo: Integer; Recursive: Boolean=True);
(introduced in version 14)
If Recursive = False, this method does not change styles in cells of selected tables (except for the case of multicell selection in a single table).
This method does nothing if UseStyleTemplates=False and TemplateNo>=0.
The method works according to the following rules:
▪if Kind of the specified style template = rvstkText, it is applied to the selected text;
▪if TemplateNo=-1, or Kind of the specified style template = rvstkParaText, or this is a "Normal" style template, the result depends on the selection. If nothing is selected, or the whole paragraph is selected, or the selection includes multiple paragraphs/cells, the method applies to the selected paragraphs. Otherwise, it applies to the selected text.
The method clears text or paragraph formatting in two cases: when it is called with TemplateNo=-1, or when it applies "Normal" style template. The results of format clearing is described in the topics about ApplyTextStyleTemplate and ApplyParaStyleTemplate.
Method type: editing-style.
TRichView © trichview.com