saveas TrvActionSaveAs

Properties   Methods

<< Click to display table of contents >>

saveas TrvActionSaveAs

Properties   Methods

TrvActionSaveAs is the action for "File | Save As..." command.

Unit RichViewActions;

Syntax

TrvActionSaveAs = class(TrvActionCustomFileIO)

hmtoggle_arrow1Hierarchy

Description

This action displays a file saving dialog and saves the content of TRichViewEdit component in the chosen file. The editor remains associated with this file name and file format, so subsequent executions of TrvActionSave action save its content in this file in this format.

The following formats are supported:

RichView Format (RVF)

Rich Text Format (RTF)

Microsoft Word Document (DocX)

Text files (TXT, Unicode and ANSI)

Markdown (MARKDOWN, MDOWN, MKDN, MD, MKD, MDWN, MDTXT, MDTEXT)

HTML

RichViewXML Format (XML, only if RichViewXML is used)

custom formats, supported in GetControlPanel.OnCustomFileOperation event.

If you use this action, you must also use TrvActionSave action.

This action must be linked to TrvActionSave action, because TrvActionSave contains a list of all documents opened in TCustomRichViewEdit controls. Besides, this action uses TrvActionSave to save the file when file name and format are chosen. This link may be defined explicitly (via ActionSave property) or implicitly (this action finds and uses TrvActionSave action placed on the same form/datamodule).

This action performs the following tasks:

1.Shows a file saving dialog allowing the user to choose the file name and format for saving.

2.If the chosen format is in LostFormatWarning of TrvActionSave, displays a warning about lossy saving.

3.Saves the file, associates TCustomRichViewEdit control with this file name and file format.

4.Calls OnDocumentFileChange event of TrvActionSave action.