2 Replies - 796 Views - Last Post: 14 April 2011 - 03:17 AM Rate Topic: -----

#1 youris  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 08-April 11

Question: Open .DOC en .ODT files in my texteditor

Posted 12 April 2011 - 12:36 AM

Hello,

I'm making a texteditor for writers. This Editor can now only open .txt files, but I want to open this files either:

.doc and .docx
.odt
.rtf

I searched over a week for this code, but cannot find it, anyway :(.

Can someone help me?

This my used code:

 Private Sub LinkerBoxToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles LinkerBoxToolStripMenuItem1.Click
       
        Dim AllText As String = "", Lineoftext As String = ""
        OpenFileDialog1.Filter = "All Files |*.*"
        OpenFileDialog1.ShowDialog()
        If OpenFileDialog1.FileName <> "" Then

        End If
        Try
            FileOpen(1, OpenFileDialog1.FileName, OpenMode.Input)
            Do Until EOF(1)
                Lineoftext = LineInput(1)
                AllText = AllText & Lineoftext & vbCrLf
            Loop
            RichTextBox1.Text = AllText
        Catch
        Finally
            FileClose(1)
        End Try
    End Sub


Thanks in advance

ps: Im dutch and not good in the english language, sorry for that!

Is This A Good Question/Topic? 0
  • +

Replies To: Question: Open .DOC en .ODT files in my texteditor

#2 Shadar  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 46
  • View blog
  • Posts: 157
  • Joined: 26-May 09

Re: Question: Open .DOC en .ODT files in my texteditor

Posted 12 April 2011 - 05:07 AM

This should help get you started:

http://social.msdn.m...c-f9e8ce2252a3/
Was This Post Helpful? 0
  • +
  • -

#3 youris  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 08-April 11

Re: Question: Open .DOC en .ODT files in my texteditor

Posted 14 April 2011 - 03:17 AM

View PostShadar, on 12 April 2011 - 05:07 AM, said:

This should help get you started:

http://social.msdn.m...c-f9e8ce2252a3/


Thanks for your help! It's not workig at all.

Now I have this code, but then i recieved a very strange thing. Like this:

ÐÏࡱá - but it's then much longer. I see the normal text too, but i preffer to see only the normal text.

Private Sub RechterBoxToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles RechterBoxToolStripMenuItem1.Click
        'Voor het rechtervlak.
            Dim open As New OpenFileDialog
        open.Title = "Titel"
        open.Filter = "Alle Bestanden (*.*)|*.*"
        If open.ShowDialog = Windows.Forms.DialogResult.OK Then
            RichTextBox2.LoadFile(open.FileName, RichTextBoxStreamType.PlainText)
        End If
    End Sub

This post has been edited by youris: 14 April 2011 - 03:18 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1