How to open txt file

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2006
Posts: 2
Reputation: khaled44 is an unknown quantity at this point 
Solved Threads: 0
khaled44 khaled44 is offline Offline
Newbie Poster

How to open txt file

 
0
  #1
Aug 9th, 2006
Hi people i'm a completly new to this i've got a form with rich text box and want to open a txt file (or other files) in the rich text box. Ive managed to work out how the open command works just wait a point in the right direction really i'm using visual basic 5

Thanks
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: How to open txt file

 
0
  #2
Aug 9th, 2006
Something to note when using a richtextbox, is the method "loadfile", which will load a .txt file (or an RTF File... Actually, it will load any file, but you might want to stick to .txt and rtf with it). You can do it that way, which is real easy, but not so much fun. Like this richtextbox1.loadfile "c:\boot.ini", which load the file "boot.ini" from root of the c drive (c:\). If you are dead set on doing it the hard way (which I am) you can use open, which follows this syntax open path for action as handle
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2
Reputation: khaled44 is an unknown quantity at this point 
Solved Threads: 0
khaled44 khaled44 is offline Offline
Newbie Poster

Re: How to open txt file

 
0
  #3
Aug 10th, 2006
Hi thanks for the pointer managed to get it to work but only opens RTF documents and not anything else, can I get it to open and view any files?
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: How to open txt file

 
0
  #4
Aug 10th, 2006
Most likely only .txt and rtf files. If you want to do processing for other kinds of files, you'll need to manually try to format the data and display it. One trick that I thought was a pretty good plan, was have the program check to see if MS word is installed, and if so, have VB use Word behind the scenes to convert the file to a .txt or a .rtf, and then display it that way (I mean for documents, if you want to do pictures and stuff, you'll have to use picturebox's or apis with device contexts....)
Last edited by Comatose; Aug 10th, 2006 at 5:36 pm.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 1
Reputation: lorraines212 is an unknown quantity at this point 
Solved Threads: 0
lorraines212 lorraines212 is offline Offline
Newbie Poster

Re: How to open txt file

 
0
  #5
Aug 12th, 2007
If I double click on my mouse, it will not open the file.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 12682 | Replies: 4
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC