Solved

VB6, microsoft word

Posted on 2013-05-31
2
368 Views
Last Modified: 2013-05-31
i have data in .rtf file format. i want to read .rft file in vb6 sequentially.  i have open file as below.

    Dim mvFileNum As Integer, mvFileName As String, inpReaddata As String
    mvFileName = "D:\TestData\Inp Data.rtf"
    mvFileNum = FreeFile()
    Open mvFileName For Input As #mvFileNum
        Line Input #1, inpReadData
    Close #mvFileNum

above code is reading one record and exit.


1. how can i read file sequentially?
2. how can i get no of lines in file so that i can set loop?
0
Comment
Question by:nitin_s_shah
2 Comments
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39210740
Hi,

Pls try

 Open mvFileName For Input As #1  
Do While Not EOF(1)   
    Line Input #1, inpReadData
Loop
Close #1 

Open in new window

Regards
0
 

Author Closing Comment

by:nitin_s_shah
ID: 39210855
Dear Rgonzo1971,

Excellent answer,

Thanks a lot for quick help

Nitin Shah
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now