How Do I save a wpf rich text box with text in it?
I have managed to load a file into a rich text box in wpf (thank-you for your help), now how can I go about saving it?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mahesh ChandPosted Dec 12, 2009, 12:43 PM
TextRange range;
FileStream fStream;
range = new TextRange(RTB.Document.ContentStart, RTB.Document.ContentEnd);
fStream = new FileStream(@"C:\junk\test.txt", FileMode.Create);
range.Save(fStream, DataFormats.Text);
fStream.Close();
Here are some more functions with RichTextBox: