Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving Rich Text Box contents to a file

Status
Not open for further replies.

BTon15

Programmer
Nov 21, 2001
29
0
0
GB
I'm writing a Text File Viewer program and need to be able to load a text file into a rich text box, and also save the contents of the rich text box back to the file after the user has done an edit.

I have no problems loading the file in via RichTextBox.FileName

Does anyone know the best way to save the text back to the file after the edit?

Thanks in advance for any help.
 
If you're saving it as rich text then:

RichTextBox1.SaveFile MyFilename, rtfRTF

else: RichTextBox1.SaveFile MyFilename, rtfText

Note MyFilename should include the path.

Experience is something you don't get until just after you need it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top