|
-
Aug 16th, 2007, 07:39 PM
#1
Thread Starter
New Member
Problem with opening MS Word Files in a treeview - vb.net
Hello all and thanks in advance, I 've got the following code to open .txt document in a treeview with no problem, but I need use MS word document instead of txt document, could you tell me how I can do it. Please note I’m using VB.net 2003.
Here is the part of the program related to my question:
Private Sub Abrir()
Dim s As string
Dim fs As New FileStream(Application.StartupPath & "\" & s & _
".txt", FileMode.Open, FileAccess.Read)
Dim m_streamReader As New StreamReader(fs)
m_streamReader.BaseStream.Seek(0, SeekOrigin.Begin)
Me.TxtCodigo.Text = ""
Dim strLine As String = m_streamReader.ReadLine()
While Not (strLine Is Nothing)
Me.TxtCodigo.Text += strLine + ControlChars.Lf
strLine = m_streamReader.ReadLine()
End While
m_streamReader.Close()
End Sub
Thank you for reading
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|