TRVStyleTemplateCollection.LoadFromRVST, SaveToRVST

<< Click to display table of contents >>

TRVStyleTemplateCollection.LoadFromRVST, SaveToRVST

The methods load and save style templates to files.

function LoadFromRVST(const FileName: TRVUnicodeString;

  Units: TRVStyleUnits;

  ARVStyle: TRVStyle = nil): Boolean;

function SaveToRVST(const FileName: TRVUnicodeString;

  Units: TRVStyleUnits): Boolean;

(changed in version 18)

Files of "RichView Styles" format contain style templates. Normally they have "rvst" extension. Files of these formats can be imported and exported in the RichViewActions' style management dialog window (displayed by TrvActionStyleTemplates action).

When saving, specify Units used by the style templates:

for RVStyle.StyleTemplates, this is RVStyle.Units;

for rvActionNew.StyleTemplates or rvActionStyleTemplates.StandardStyleTemplates, this is RVAControlPanel.UnitsProgram.

When loading, Units are specified similarly. LoadFromRVST converts the loaded style templates to the specified Units.

ARVStyle parameter is necessary if you load styles into the collection that is not linked to any TRVStyle component. Specify TRVStyle component which will be used for unit conversion (if the file is measured in units different from Units).

Note: after loading to RVStyle.StyleTemplates, clear RVStyle.TextStyles and ParaStyles (because the old items may contain references to previous style templates). Then you can add default text and paragraph styles (see the example).

Example:

Demos\*\Editors\StyleTemplates\ demo loads "default.rvst" in "File | New" command.

See also

InsertFromRVST

LoadFromStreamRVST, SaveToStreamRVST