Opening a text files for viewing, like a ReadMe file 
Author Message
 Opening a text files for viewing, like a ReadMe file

I want to open a text file so the user can read it, not for use by the
program to read in info. Example: a user clicks a command button to open a
readme text file. Please help! Thanks!


Wed, 25 Feb 2004 04:09:57 GMT  
 Opening a text files for viewing, like a ReadMe file
This should get you started....

http://groups.google.com/groups?as_q=open%20text%20file&as_ugroup=mic...

LFS

Quote:

> I want to open a text file so the user can read it, not for use by the
> program to read in info. Example: a user clicks a command button to open a
> readme text file. Please help! Thanks!



Wed, 25 Feb 2004 07:23:49 GMT  
 Opening a text files for viewing, like a ReadMe file

Hello Steve,
        If you main concern here is to allow a user to read the file, you can
shell notepad and pass it the path and filename to your readme.  Otherwise
you will need to open the file and read each line into a control such as a
textbox that is marked as readonly.  
Below is a small snippet of code that should load a file into your form
that contains a Multiline Textbox control.

Option Explicit
Private Sub Form_Load()
    Dim TextLine As String
    With Text1
        .Left = 0
        .Top = 0
        .Text = ""
        .Visible = False
        .Locked = True
    End With
    Open "c:\mytextdoc.txt" For Input As #1
    Do While Not EOF(1)
        Line Input #1, TextLine
        Text1.Text = Text1.Text & TextLine & vbCrLf
    Loop
    Close #1
    Text1.Visible = True
End Sub

Private Sub Form_Resize()
    Text1.Width = Form1.ScaleWidth
    Text1.Height = Form1.ScaleHeight
End Sub

Good Luck
Roy Strickland
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
reserved.



Sat, 28 Feb 2004 02:52:57 GMT  
 Opening a text files for viewing, like a ReadMe file
http://www.mvps.org/vbnet/faq/main/fileloadtext.htm

--

Randy Birch
MVP Visual Basic

http://www.mvps.org/vbnet/

Please respond only to the newsgroups so all can benefit.


: I want to open a text file so the user can read it, not for use by the
: program to read in info. Example: a user clicks a command button to open a
: readme text file. Please help! Thanks!
:
:



Sat, 28 Feb 2004 06:24:56 GMT  
 
 [ 4 post ] 

 Relevant Pages 

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

2. Opening ReadMe text file woes

3. Opening a readme.txt file

4. OPENING A README FILE????

5. OPENING A README FILE????

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

7. Open a text file, search for place holder, then write data to file

8. Adding Readme.txt files to VB

9. MS Readme file on Oleaut32.dll Issue

10. include some file(like Readme.txt) in Distribution...

11. include some file(like Readme.txt) in Distribution...

12. DAO Blob Adding/Extracting (audio files, text files, image files, program files)

 

 
Powered by phpBB® Forum Software