Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB6, microsoft word

Posted on 2013-05-31
2
Medium Priority
?
399 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 53

Accepted Solution

by:
Rgonzo1971 earned 2000 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 to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

824 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