rtf to plain text

  • Thread starter Thread starter Tam Inglis
  • Start date Start date
T

Tam Inglis

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
 
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.
 
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.
 
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
 
Back
Top