VBA

Moderators: PavlinII
Number of threads: 1614
Number of posts: 3000

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Opening And Reading Text Files Posted by iori85z on 3 Sept 2004 at 12:21 AM
Hi, I am new to Visual Basic and currently, I need to do a small software, which has a Open button and a textbox. So when I press the open button, it is suppose to open the open dialog box for users to select the text(log) files in C: to open. Then when the user open it, the contents will be viewed on the textbox. Does anyone has a code or solution for this, any help will be greatly appreciated. Thanks.
Report
Re: Opening And Reading Text Files Posted by PavlinII on 19 Sept 2004 at 10:14 AM
: Hi, I am new to Visual Basic and currently, I need to do a small software, which has a Open button and a textbox. So when I press the open button, it is suppose to open the open dialog box for users to select the text(log) files in C: to open. Then when the user open it, the contents will be viewed on the textbox. Does anyone has a code or solution for this, any help will be greatly appreciated. Thanks.
:
Hi
Dim iFile as integer, strLog as string, FileName as string
    iFile = FreeFile()
    FileName = "C:\logFile.log"
    Open FileName For Binary Access Read As #iFile
    strLog = Space(FileLen(FileName))
    Get #iFile, , strLog
    Close #iFile
    Text1.Text=strLog

There exists several ways to get text from file... this is one of them


Pavlin II[/size]

Don't take life too seriously anyway you won't escape alive from it!


Report
Re: Opening And Reading Text Files Posted by ghdavis on 17 Oct 2004 at 4:26 PM
: : Hi, I am new to Visual Basic and currently, I need to do a small software, which has a Open button and a textbox. So when I press the open button, it is suppose to open the open dialog box for users to select the text(log) files in C: to open. Then when the user open it, the contents will be viewed on the textbox. Does anyone has a code or solution for this, any help will be greatly appreciated. Thanks.
: :
: Hi
:
Dim iFile as integer, strLog as string, FileName as string
:     iFile = FreeFile()
:     FileName = "C:\logFile.log"
:     Open FileName For Binary Access Read As #iFile
:     strLog = Space(FileLen(FileName))
:     Get #iFile, , strLog
:     Close #iFile
:     Text1.Text=strLog

: There exists several ways to get text from file... this is one of them
:
:
: Pavlin II[/size]
:
: Don't take life too seriously anyway you won't escape alive from it!
:
:
:




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.