TCustomRichView.SaveTextToStream, SaveTextToStreamW

<< Click to display table of contents >>

TCustomRichView.SaveTextToStream, SaveTextToStreamW

The methods export document or selection as ANSI (SaveTextToStream) or Unicode (SaveTextToStreamW) text.

function SaveTextToStream(const Path: TRVUnicodeString; Stream: TStream;

  LineWidth: Integer; SelectionOnly, TextOnly: Boolean;

  CodePage: Cardinal=CP_ACP):Boolean;

function SaveTextToStreamW(const Path: TRVUnicodeString; Stream: TStream;

  LineWidth: Integer; SelectionOnly, TextOnly: Boolean):Boolean;

(introduced in version 1.3; changed in version 18)


LineWidth is used for saving breaks (they are saved as LineWidth '-' characters)

Path path for saving images and other non-text items (they are not saved by default, but this parameter is used in OnSaveImage2, OnSaveComponentToFile, and OnSaveItemToFile events);

SelectionOnly if True, only selected part of the document is saved.

TextOnly if True, non-text items are ignored when saving. If False, text representation of items is saved.


unicode Unicode notes:.

Internally, text is stored as Unicode. SaveTextToStream converts Unicode to ANSI using CodePage parameter. If CodePage=CP_ACP, Style.DefCodePage is used instead.


Return value: "successful saving?"


See also methods:

SaveText, SaveTextW;

LoadTextFromStream, LoadTextFromStreamW.

See also events:




See also:

Saving and loading RichView documents.