how to print a file seperately

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nivaz
    New Member
    • Feb 2008
    • 17

    how to print a file seperately

    hai friends,

    i really want to know how to read a file seperately. that means i want to read and print first 24 lines then if i click the next button i will read and print tihe next 24 lines. try to post ur replies.
  • jeffstl
    Recognized Expert Contributor
    • Feb 2008
    • 432

    #2
    Originally posted by nivaz
    hai friends,

    i really want to know how to read a file seperately. that means i want to read and print first 24 lines then if i click the next button i will read and print tihe next 24 lines. try to post ur replies.

    Something along these lines, you need to declare your FSO , etc still though.

    Code:
    Open FilePath For Input As MyFile
    Do While Not EOF(MyFile)
       For x=0 to 23
          Line Input #MyFile, sNextLine
          sNextLine = sNextLine & vbCrLf
          sText = sText & sNextLine
       Next x
       'some code for whatever
    Loop
    You might run into some problems though hitting the end of the file in the middle of a for next loop.

    You might want to research all the methods in the FSO to handle these problems and trap them as they occur.

    Comment

    Working...