Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Opening files with VB 6.0

mercury2025mercury2025 Posts: 1Member
Hi, i am a begginer to VB and i am trying to create a program which opens all files within the same directory.

What i want it to do is, open file 'x' then print it then close it, open file 'y' print it, close it, open file 'z' print it, close it. and so on. I want to do it automatically as the files i wish to print are large and take alot of time at work to print out and create large printing queues.

Any help would be great thank you!

Comments

  • KDivad LeahcimKDivad Leahcim Posts: 3,948Member
    : Hi, i am a begginer to VB and i am trying to create a program which opens all files within the same directory.
    :
    : What i want it to do is, open file 'x' then print it then close it, open file 'y' print it, close it, open file 'z' print it, close it. and so on. I want to do it automatically as the files i wish to print are large and take alot of time at work to print out and create large printing queues.
    :
    : Any help would be great thank you!
    :
    :
    [code]
    Dim FN As String
    Dim FT As String
    Dim FFile As Long
    ChDir "Folder to work in"
    FN = Dir$("*.*")
    Do Until FN = ""
    FFile = FreeFile
    On Error Resume Next
    Open FN For Binary As FFile
    If Err.Number = 0 Then
    FT = String$(LOF(FFile), 0)
    Get FFile, , FT
    Close FFile
    Printer.Print FT
    End If
    FN = Dir$()
    Loop
    [/code]
Sign In or Register to comment.