My application requires the saving of the content of a RichTextBox to tile. This I can achieve, however after closing the application and then re-running it, the file exists indicated by the ms word icon but the file is empty, the text from the RichTextBox is lost. Any help with this problem or general advice on saving RTF file would be most appreciated. I use this format as I need to retain all the formatting applied to the text but I also need to re-load the RichTextBox with the saved data.
Private Sub btnSaveFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveFile.Click
RichTextBox1.SaveFile("hello.rtf")
'Saves the file to hard disk
End Sub
Private Sub btnReadFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnread.Click
RichTextBox1.LoadFile("hello.rtf")
'Loads the file from the hard disk
End Sub
Private Sub btnSaveFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveFile.Click
RichTextBox1.SaveFile("hello.rtf")
'Saves the file to hard disk
End Sub
Private Sub btnReadFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnread.Click
RichTextBox1.LoadFile("hello.rtf")
'Loads the file from the hard disk
End Sub