Opening rtf and text files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to code for the Sub FileOpen to open rtf and text file but it does not work.
Like: RichTextBox.LoadFile(FileOpenDialog1.FileName)
RichTextBox.Text(FileOpenDialog1.FileName).
Are there any way to code situation like this. The Error saying "Invalid File Format" Can anyone help?

jbat
 
Hi,

Try with
RichTextBox.LoadFile(FileOpenDialog1.FileName,
RichTextBoxStreamType.PlainText)
 
It did open the text as usual but the RTF was open in formatting way not as you can read it.

jbat
 
It did open the text as usual but the RTF was open in formatting way not as you can read it.

jbat

I think this means that your rtf file is not formatted properly. What
Miha suggested to you allows you to open any text file into a
RichTextBox.

It looks like you will have to find the error in the rtf file.
Otis Mukinfus
http://www.otismukinfus.com
 
Back
Top