When I copy from MS Word, and paste to RichviewEdit, I just want the plain text, don't need the font style. How can I do it?
Thanks!
How can I get plain text when I paste from MS Word?
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Look also here
http://www.trichview.com/forums/viewtop ... nicodetext
I use this code for pasting only text
in OnPaste event handler of TRichViewEdit
var s: wideString; Data: THandle;
Clipboard.Open;
Data := GetClipboardData(CF_UNICODETEXT);
try
if Data <> 0 then
s := PWideChar(GlobalLock(Data))
else
s := '';
finally
if Data <> 0 then GlobalUnlock(Data);
Clipboard.Close;
end;
Sender.InsertTextW(s, False);
DoDefault := False;
http://www.trichview.com/forums/viewtop ... nicodetext
I use this code for pasting only text
in OnPaste event handler of TRichViewEdit
var s: wideString; Data: THandle;
Clipboard.Open;
Data := GetClipboardData(CF_UNICODETEXT);
try
if Data <> 0 then
s := PWideChar(GlobalLock(Data))
else
s := '';
finally
if Data <> 0 then GlobalUnlock(Data);
Clipboard.Close;
end;
Sender.InsertTextW(s, False);
DoDefault := False;