Solved

VB6, microsoft word

Posted on 2013-05-31
2
381 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 51

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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 use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

738 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