Solved

VB6, microsoft word

Posted on 2013-05-31
2
385 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 52

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

623 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