Hi to all, I need to operate on an RTF as follows: after opening it as a textfile, I read a line at a time and check its TEXT contents. In some cases I just discard that line, in other cases I have to store it in a string and save it.
How can I convert my strings with RTF text into strings with TXT text?
Many thanks in advance for your reply.
Paolo
Team
Delphi Developer
Thu, 27 Jan 2005 04:56:55 GMT
Re:RTF CONVERSION
Quote
In article <3D5549D9.9CA71...@inwind.it>, Pcortelli wrote: > I need to operate on an RTF as follows: after opening it > as a textfile, I read a line at a time and check its TEXT > contents. In some cases I just discard that line, in other > cases I have to store it in a string and save it.
> How can I convert my strings with RTF text into > strings with TXT text?
> Many thanks in advance for your reply.
The easiest way by far is to load the RTF file into a rich edit control with Plaintext = false, via richedit.lines.loadfromfile. After that the Lines and Text properties give you access to the plain text.
The other option is to write or find a rich text parser. Writing one is not a trivial task, though.
-- Peter Below (TeamB) Use the newsgroup archives : http://www.mers.com/searchsite.html http://www.tamaracka.com/search.htm http://groups.google.com http://www.prolix.be