01-25-2012, 05:51 PM
how to convert rtf to plain text?
Convert rtf to plain text
|
01-25-2012, 07:11 PM
01-25-2012, 07:54 PM
that does not work.
i have rtf code which needs to be converted. {\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 Segoe UI;}}
01-25-2012, 07:59 PM
oh, mine was assuming you had the text itself copied into the clipboard before stripping it.
01-25-2012, 08:05 PM
this should work
int hwnd=CreateWindowEx(0 "RichEdit20W" 0 0 ...) ;;create rich edit control str file=... ;;temp file rtf.setfile(file) RichEditLoad(hwnd file) ;;load rtf into the control text.getwintext(hwnd) ;;get text from the control DestroyWindow hwnd
01-25-2012, 08:06 PM
that rtf output comes from my csharp application, i tried a 3rd party component. now some of my text has such rtf code..
01-25-2012, 08:14 PM
can that be done without any dialog?
string rtf=s.get.sel out rtf.plainText
01-25-2012, 08:16 PM
Create hidden rich text control without parent dialog.
Other solution would be to use Word through COM. But it would run hidden Word process temporarily.
01-25-2012, 08:20 PM
i thought that you have a simple stripper class.
similar to removing all html tags from _s
11-11-2014, 04:09 PM
I tried this, but it doesnt work
Macro Macro23 int hwnd=CreateWindowEx(0 "RichEdit20W" 0 0 0 0 0 0 0 0 0 0) ;;create rich edit control But I think the hwnd isn't properly declared. (or did I mis something else?)
11-12-2014, 06:03 AM
Function RtfToText
;/ test Macro Macro2471 out Function RtfToText2 ;/
11-12-2014, 01:07 PM
Wow! Thank you!!!
11-20-2014, 11:02 AM
I think this post write very good!
|
« Next Oldest | Next Newest »
|