Page 1 of 1

Get selected text as HTML

Posted: Mon Jun 16, 2014 5:21 pm
by gdemers_logilys
I know I can use SaveHTML to export everything in the TRichViewEdit to HTML.

I want exactly the same thing but with the selected text only. Is there a way to do this ?

I could create a second RichView and Copy/Paste the selected text in the other one and call SaveHTML. But I don't want to use the user clipboard to do it.

Posted: Tue Jun 17, 2014 1:36 pm
by Sergey Tkachenko
TRichView does not have methods for saving selection as HTML.
You need to copy selection to the second TRichView and save it.
It's not necessary to use clipboard - save the selection to TMemoryStream using SaveRVFToStream(Stream, True), and load it using LoadRVFFromStream.