[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

VB6, microsoft word

Posted on 2013-05-31
2
Medium Priority
?
400 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 Shah
2 Comments
 
LVL 54

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 Shah
ID: 39210855
Dear Rgonzo1971,

Excellent answer,

Thanks a lot for quick help

Nitin Shah
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

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

This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
In this article, I will demonstrate that how to do a PST migration from Exchange Server to Office 365. This method allows importing one single PST, or multiple PST's at once.
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 …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

607 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