2 Replies - 1832 Views - Last Post: 14 January 2011 - 10:03 AM Rate Topic: -----

#1 koeshkoesh  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 59
  • Joined: 27-December 08

opening a non word file in a richtextbox?!

Posted 14 January 2011 - 09:36 AM

Hello guys, ive been trying to solve this for days now, but i cant get it.

what i am planning to do:
Making a form wich contains a richtextbox, then using a string that includes the path of the file and the filename, example path: C:\lol.gfc
if you would've check the string you will see that it is a non word document, i want to get the text wich is in this file in my richtextbox.
i know that there are just normal characters and normal text in this document and i can open it with wordpad.
this is how far i came...
FileOpen(1, pathstring, OpenMode.Random, OpenAccess.ReadWrite, _
   OpenShare.Shared)


i dont want you guys to make my homework cause i didnt do anything myself yet, well i tryed but it never worked and i didnt came further than the ofileopen command. i am just asking if anyone has any ideas to give me a headstart :D

Greetings Koeshkoesh

This post has been edited by koeshkoesh: 14 January 2011 - 09:46 AM


Is This A Good Question/Topic? 0
  • +

Replies To: opening a non word file in a richtextbox?!

#2 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1606
  • View blog
  • Posts: 5,163
  • Joined: 25-September 09

Re: opening a non word file in a richtextbox?!

Posted 14 January 2011 - 09:52 AM

Look into the .LoadFile method of the RichTextBox control, you can load a standard PlainText file using that method.

RichTextBox1.LoadFile("D:\SomeTextFile.Txt", RichTextBoxStreamType.PlainText)


is an example of using the .LoadFile method.

This post has been edited by CharlieMay: 14 January 2011 - 09:53 AM

Was This Post Helpful? 2
  • +
  • -

#3 koeshkoesh  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 59
  • Joined: 27-December 08

Re: opening a non word file in a richtextbox?!

Posted 14 January 2011 - 10:03 AM

why is this stuff always that easy :S,
thanks anyways you just helped me with a biiiig questionmark :D thumbsup :D

why is this stuff always that easy :S,
thanks anyways you just helped me with a biiiig questionmark :D thumbsup :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1