| View previous topic :: View next topic |
| Author |
Message |
cakk
Joined: 17 Dec 2009 Posts: 14
|
Posted: Tue Jan 05, 2010 8:16 am Post subject: How can I get plain text when I paste from MS Word? |
|
|
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! |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6607
|
Posted: Tue Jan 05, 2010 8:55 am Post subject: |
|
|
Call PasteText.
If you use RichViewAction, use a new action: TrvActionPasteAsText (in the ActionTest demo, this is "Edit | Paste as Text" command). |
|
| Back to top |
|
 |
emo
Joined: 21 Nov 2007 Posts: 8
|
Posted: Tue Jan 05, 2010 8:02 pm Post subject: |
|
|
Look also here
http://www.trichview.com/forums/viewtopic.php?t=22&highlight=cfunicodetext
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; |
|
| Back to top |
|
 |
cakk
Joined: 17 Dec 2009 Posts: 14
|
Posted: Sat Jan 16, 2010 5:02 pm Post subject: |
|
|
| Thanks. It's Works good! |
|
| Back to top |
|
 |
|