How to convert list markers to plain text

General TRichView support forum. Please post your questions here
Post Reply
saeid2016
Posts: 72
Joined: Wed Mar 16, 2016 11:56 am

How to convert list markers to plain text

Post by saeid2016 »

Hello,

I want to save text of RichViewEdit1 to DB as plain text. if I use the following code, The list markers does not save.

Code: Select all

RichViewEdit1.SelectAll;
RichViewEdit1.GetSelText;
if I use SaveTextToStream, all non text items such as footnotes , ... are saved.

How I save the list markers with main text as plain text?

Is it possible to convert list markers to text item?
saeid2016
Posts: 72
Joined: Wed Mar 16, 2016 11:56 am

Re: How to convert list markers to plain text

Post by saeid2016 »

Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: How to convert list markers to plain text

Post by Sergey Tkachenko »

I am glad you solved the problem.

Please note that GetSelText calls SaveTextToStream inside, with the parameter TextOnly. With this parameter, a text representations of non-text items are not saved (except for tables and items inherited from label-item, such as footnotes and endnotes).
If you need a text representation of all items, use SaveTextToStream instead of GetSelText.
saeid2016
Posts: 72
Joined: Wed Mar 16, 2016 11:56 am

Re: How to convert list markers to plain text

Post by saeid2016 »

Sergey Tkachenko wrote: Mon Oct 16, 2017 3:01 pm If you need a text representation of all items, use SaveTextToStream instead of GetSelText.
Now, with TextOnly parameter, a text representation of all non text items will be saved or not. I suggest you add a parameter to SaveTextToStream to choose what non text items we want t save their text representation.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: How to convert list markers to plain text

Post by Sergey Tkachenko »

You can suppress saving certain items using OnSaveItemToFile event.
Check for SaveFormat = rvsfText, assign OutStr := '' and DoDefault := False.
Post Reply