how do you open an RTF file through VB.net

i'm trying to open a RTF file but i always seem to get the code as

Page 1 of 1

2 Replies - 12323 Views - Last Post: 16 March 2008 - 02:16 PM Rate Topic: -----

#1 andrew2008  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 16-March 08

how do you open an RTF file through VB.net

Post icon  Posted 16 March 2008 - 12:58 PM

hey, using vb 2005 and i'm trying to use the open/save file dialogs i can save files fine, but when i try to open them i get the rich text formatting codes but not the data inside the .rtf file ( opening it in wordpad shows up correctly though) any help with this would be greatly appreciated
Is This A Good Question/Topic? 0
  • +

Replies To: how do you open an RTF file through VB.net

#2 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: how do you open an RTF file through VB.net

Posted 16 March 2008 - 01:38 PM

What control are you using to display the RTF file?
Was This Post Helpful? 0
  • +
  • -

#3 andrew2008  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 16-March 08

Re: how do you open an RTF file through VB.net

Posted 16 March 2008 - 02:16 PM

dim strfilename as string 
With OpenFileDialog1
			.Filter = "RICHTEXT FILES (*.rtf) |*.rtf"
			.FilterIndex = 1
			.InitialDirectory = "c:\"
			.Title = "OPEN FILE"
			.FileName = ""
		End With
		If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
			STRFILENAME = OpenFileDialog1.FileName
			Dim OBJREADER As StreamReader = New StreamReader(STRFILENAME)
			richTextBox1.Text = OBJREADER.ReadLine

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1