devxlogo

Saving RichTextBox as Plain Text

Saving RichTextBox as Plain Text

Question:
How can I output straight ASCII text from the Rich Text Box control, and NOT Rich text?

Answer:
The SaveFile method of the RichTextBox control can be called with an additional argument: filetype. If you call SaveFile as follows, it will save your text without any RTF tags:

RichTextBox.SaveFile “testfile.txt”, 1

devx-admin

Share the Post: