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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top