open a txt file for the user to view and read 
Author Message
 open a txt file for the user to view and read

Hi all

i have an application that i am providing some txt files as a part of the
files for the users

i am looking for a way that the user can click a menu selection and have the
appropriate txt file open so the user can read it!

any help is appreciated!

Mike



Thu, 13 Jan 2005 00:46:10 GMT  
 open a txt file for the user to view and read

Open "c:\MyFile.txt" for input as #1

strBuffer = input LOF(1), #1
txtMyText.Text = strBuffer

close 1


Quote:
> Hi all

> i have an application that i am providing some txt files as a part of the
> files for the users

> i am looking for a way that the user can click a menu selection and have
the
> appropriate txt file open so the user can read it!

> any help is appreciated!

> Mike



Thu, 13 Jan 2005 03:23:09 GMT  
 open a txt file for the user to view and read
Open a new Standard EXE project in VB6.  Drag one each of Drive,
Directory, and File list boxes onto the form.  Add the Microsoft
RichTextBox to your component list click Project menu item and then
click Components) and drag one onto the form.  Then open the code for
the form and copy in the following code shown below.  You will have a
fully functional file selection/display program.  On your own you can
preset directories if you want, change the File Pattern (which is set
to *.txt in the Form_Load event), etc.

------------------------------------------------------

Private Sub Dir1_Change()
 File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
 Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_DblClick()
 If File1.ListIndex > -1 Then
  fil$ = File1.Path
  If Right$(fil$, 1) <> "\" Then fil$ = fil$ + "\"
  fil$ = fil$ + File1.List(File1.ListIndex)
  RichTextBox1.FileName = fil$
 End If
End Sub

Private Sub Form_Load()
 File1.Pattern = "*.txt"
End Sub

------------------------------------------------------------



Thu, 13 Jan 2005 07:22:32 GMT  
 open a txt file for the user to view and read
Or ... you could use the SHELL command to
open NOTEPAD and the specific text file
you want the user to read.

--- Jim

"Will the road you're on get you to My place ?" - God
                   _\|/_
                   (o o)
   ------oOO-{_}-OOo------



Fri, 14 Jan 2005 12:07:53 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. open txt file and read strings

2. Open and .txt files for read only problem

3. opening / saving files with MS rich text box control (viewing open files)

4. Export a view to a txt o excel File

5. Viewing .txt files

6. View .txt file with default app

7. Viewing txt files from VB

8. Adding .TXT files to a VB program without the .TXT file

9. OPening file but can't view Script in file

10. On-demand Subreport--Want to automate opening ODS from user clicking tree view node

11. On-demand Subreport--Want to automate opening ODS from user click ing tree view node

12. Opening a text files for viewing, like a ReadMe file

 

 
Powered by phpBB® Forum Software