Link to home
Start Free TrialLog in
Avatar of richardSlade
richardSlade

asked on

RichTextBox - Save as text with formatting

Hi,
I have a richtextbox on a C# 2.0 Windows Form. The RichTextBox displays T-SQL Syntax that is highlighted using RTF. I want to save the contents of the RTB to a text file. It should only save the text, not the RTF characters but I want to preserve the formatting line breaks and indentation.
If I save the Text, I don't get hte formatting, if I save the RTF I get all the characters.

Thanks in advance.

Rich
ASKER CERTIFIED SOLUTION
Avatar of ZachSmith
ZachSmith
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of richardSlade
richardSlade

ASKER

Thanks - I'd done that in all osrts of other places, so I wish I'd tried it before. Worked lovely though. Cheers