This is the discussion forum for the HtmlEditor. See also the
HtmlEditor home page, where you can download the control, and the
Documentation Wiki, a collaborative project for documenting the control.
How to disable paste with html tags?
Posted by:
Silat (---.clients.easynet.fr)
Date: Monday, 15-May-2006, 14:18:15
Hello,
Every time I paste data (CTRL+V) into your (wonderfull) component, it will embedded the text I paste with some HTML tags (font, size, ....). Is it possible to only paste the text without the HTML tags?
Cheers,
Silat.
Re: How to disable paste with html tags?
Posted by:
Prakash (---.pacific.net.in)
Date: Wednesday, 13-Dec-2006, 08:11:20
I know this thread is old but for others i think this piece can help
in the on paste of the editor or somwhere else you can do this.
return this.execCommand(MSHTMCMDID.IDM_PASTE, null, false, true);
if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text))
{
IHTMLDocument2 iDoc2 = (IHTMLDocument2)this.Document;
IHTMLTxtRange txtRange = IHTMLTxtRange)iDoc2.GetSelection().createRange();
txtRange.text = Clipboard.GetDataObject().GetData(DataFormats.Text).ToString();
return true;
}
return false;
instead of