473,385 Members | 1,587 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

rtf to plain text

I can find plenty of examples on how to encode and otherwise create rtf from
plain text.

Need to take rtf string and convert to its plain string equivalent. Been
looking around for a few hours now and i cant imagine its hard, im just
missing it.

thanks in advance

Tam
Nov 15 '05 #1
4 8107
well i solved it by passing the complete rtf string to a recursive function.

tests each character and appends it to a new string dependant on a bool set
by '<' for false and '>' for true.

works well but i cant help feeling ive flogged the proverbial horse here ;-)

still welcome another method.

"Tam Inglis" <jo***********@btclick.com> wrote in message
news:br**********@hercules.btinternet.com...
I can find plenty of examples on how to encode and otherwise create rtf from plain text.

Need to take rtf string and convert to its plain string equivalent. Been
looking around for a few hours now and i cant imagine its hard, im just
missing it.

thanks in advance

Tam

Nov 15 '05 #2
Nothing simpler than that.

RichTextBox rtb = new RichTextBox();
rtb.Rtf = myString;
Console.WriteLine(rtb.Text);

and vice versa.

The RichTextBox is never shown since you don't nedd to add it to the
dialogcontrols.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
Nov 15 '05 #3
sure but its still encoded at that point as rtf, i just want the content.

"codymanix" <do*********************@gmx.de> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Nothing simpler than that.

RichTextBox rtb = new RichTextBox();
rtb.Rtf = myString;
Console.WriteLine(rtb.Text);

and vice versa.

The RichTextBox is never shown since you don't nedd to add it to the
dialogcontrols.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk

Nov 15 '05 #4
Please accept my sincerest apologies.

I had thought of doing as you suggest except of course i was setting its
text through its Text method and not rtf.

Either way I should have tried your response, which was of course correct,
before refuting it.

I shall 'cut a switch' in the morning and administer a sound thrashing to
myself

"codymanix" <do*********************@gmx.de> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Nothing simpler than that.

RichTextBox rtb = new RichTextBox();
rtb.Rtf = myString;
Console.WriteLine(rtb.Text);

and vice versa.

The RichTextBox is never shown since you don't nedd to add it to the
dialogcontrols.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk

Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Alfredo Agosti | last post by:
Hi folks, I have an Access 2000 db with a memo field. Into the memo field I put text with bold attributes, URL etc etc What I need to to is converting the rich text contained into the memo...
10
by: J. Alan Rueckgauer | last post by:
Hello. I'm looking for a simple way to do the following: We have a database that serves-up content to a website. Some of those items are events, some are news articles. They're stored in the...
3
by: pradeep gummi | last post by:
I have an XML FILE that is to be converted to Plain Text using an XSL file. Since I just want plain text, I do not want to set any root element during transformation.And if I do not any root...
14
by: Akseli Mäki | last post by:
Hi, Hopefully this is not too much offtopic. I'm working on a FAQ. I want to make two versions of it, plain text and HTML. I'm looking for a tool that will make a plain text doc out of the...
8
by: LRW | last post by:
I'm not sure this message is totally appropriate for this group, so please, if anyone has a better group suggestion, let me know! My company sends out a monthly newsletter in HTML format to our...
2
by: Mike Bridge | last post by:
Is there any way to get Internet explorer to treat a text/plain .net page as plain text using asp.net? It seems like IE doesn't trust text/plain as a mime type, and so it (ironically) displays it...
3
by: MarkMurphy | last post by:
I have a simple export.aspx page that allows a user to fill in a form to export some data. The postback logic writes the data to the response stream. I have two small issues: 1) The data is...
8
by: Doominato | last post by:
good day, I was just wondering how can I download a web page as plain text from a certain web site. I have tried to use the OpenURL() method from INET control in my VB.NET app, but it returns...
10
by: Eric Lindsay | last post by:
This may be too far off topic, however I was looking at this page http://www.hixie.ch/advocacy/xhtml about XHTML problems by Ian Hickson. It is served as text/plain, according to Firefox...
6
by: monomaniac21 | last post by:
hi all how can u send a plain text version of an email with the html so that the users mail client can access this plain text version? kind regards marc
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.