Currently using code below on a button click event to save the contents of a rich text box:
tbMix combines the text of tbFileName2 and tbScriptName to create a file path which is the file that the rich text box is created to.Code:tbMix.Text = IO.Path.Combine(tbFileName2.Text, _ IO.Path.ChangeExtension(String.Join("", tbScriptName.Text.Where(Function(TheChar As Char, TakeVar As Boolean) _ Not IO.Path.GetInvalidPathChars.Contains(TheChar)).ToList), ".doc")) Dim objwriter As New System.IO.StreamWriter(tbMix.Text) objwriter.Write(tbUpperBody.Text) objwriter.Close()
however, when i format things in the rich text box, eg as bold etc, and then reopen the contents of the file, the formatting has not been saved.
why is this? can anyone solve the problem?
thanks




Reply With Quote
