TCustomRichView.StyleTemplateInsertMode

<< Click to display table of contents >>

TCustomRichView.StyleTemplateInsertMode

Controls how Style.StyleTemplates affect insertion of RTF, DocX, RVF, XML (by TRichViewXML component) files or streams.

type

  TRVStyleTemplateInsertMode =

    (rvstimUseTargetFormatting, rvstimUseSourceFormatting,

     rvstimIgnoreSourceStyleTemplates); 

property StyleTemplateInsertMode: TRVStyleTemplateInsertMode;

(introduced in version 14)

This property is used only if UseStyleTemplates=True.

Mode

Meaning

rvstimUseTargetFormatting

Use formatting of the current (target) document

rvstimUseSourceFormatting

Use formatting of the inserted (source) document

rvstimIgnoreSourceStyleTemplates

Ignore styles in the inserted (source) document.

1) rvstimUseTargetFormatting

If the source document and the target document have styles templates of the same name, text (and paragraphs) of this style template is formatted according to the target style template.

For example, let the source document has a style template named "heading 1" defining text color=red, and some text formatted as "heading 1"+bold, i.e. it looks red and bold. Let the target document has a style template of the same name, defining text color=black. When this text is inserted, it is formatted as "heading 1"+bold, i.e. it looks black+bold.

Only style templates having new names are added from the source document to the target document.

2) rvstimUseSourceFormatting

If the source document and the target document have style templates of the same name, text (and paragraphs) of this style template is formatted according to the source style template.

In the example above, this text is inserted as "heading 1"+red+bold, so it looks like in the source document, despite of linking to the target document's "heading 1" instead of the source document's "heading 1".

Only style templates having new names are added from the source document to the target document.

3) rvstimIgnoreSourceStyleTemplates

Style templates from the source document are ignored. The inserted paragraphs are linked to the target document's "Normal" style template (if it exists). The inserted text is unstyled, except for hyperlinks (they are linked to the target document's "Hyperlink" style, if it exists).

In the example above, this text is inserted as "Normal"+red+bold, so it looks like in the original document.

Note

When inserting unstyled paragraphs, the "Normal" style template is applied to them. To insert them unstyled in modes (1) and (2), you can assign the global variable RichViewAutoAssignNormalStyleTemplate = False. In the mode (3), "Normal" is always applied.

Default value

rvstimUseTargetFormatting

See also:

Styles and style templates.