trichview.com Forum Index trichview.com
TRichView support forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How can I get plain text when I paste from MS Word?

 
Post new topic   Reply to topic    trichview.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
cakk



Joined: 17 Dec 2009
Posts: 14

PostPosted: Tue Jan 05, 2010 8:16 am    Post subject: How can I get plain text when I paste from MS Word? Reply with quote

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
View user's profile Send private message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6607

PostPosted: Tue Jan 05, 2010 8:55 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
emo



Joined: 21 Nov 2007
Posts: 8

PostPosted: Tue Jan 05, 2010 8:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
cakk



Joined: 17 Dec 2009
Posts: 14

PostPosted: Sat Jan 16, 2010 5:02 pm    Post subject: Reply with quote

Thanks. It's Works good!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    trichview.com Forum Index -> Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group