Do you mean how to paste HTML format from the Clipboard?
When document is copied to the Clipboard in HTML format, not only HTML code but also a special header is copied.
For example:
Code: Select all
Version:1.0
StartHTML:000000173
EndHTML:000000859
StartFragment:000000205
EndFragment:000000827
SourceURL:https://www.trichview.com/forums/posting.php?mode=reply&f=2&t=9752
<html><body><!--StartFragment--><a href="https://www.trichview.com/forums/viewtopic.php?f=2&t=9752" style="background-color: transparent; color: rgb(211, 17, 65); direction: ltr; display: inline-block; font-family: "Trebuchet MS",Arial,Helvetica,sans-serif; font-size: 20px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: underline; text-indent: 0px; text-transform: none; unicode-bidi: embed; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">TRichViewEdit</a><!--EndFragment--></body></html>
It is important, because header contains the source URL, it is necessary to import images (otherwise, in your example, there is not way to know where is "smile.gif" located).
The both HTML importer components (TrvHtmlImporter and TrvHtmlViewImporter) can load HTML from the Clipboard: they have LoadFromClipboard method. These methods do not insert the Clipboard content in the caret position; instead they load it into TRichView (i.e. replace the existing document).
But you can load it in a temporal TRichView, copy its content to a stream (SaveRVFToStream) and then paste in the main editor (insertRVFFromStreamEd). You can use its OnPaste event for this.
If you use RichViewAction, they do HTML pasting automatically. Just assign TrvHTMLViewImporter (recommended) or TrvHtmlImporter component to TRVAControlPanel.
HTMLComponent.