Get selected text as HTML

General TRichView support forum. Please post your questions here
Post Reply
gdemers_logilys
Posts: 13
Joined: Mon Jun 16, 2014 1:10 pm

Get selected text as HTML

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
Post Reply