Opening files with VB 6.0 - Programmers Heaven

Howdy, Stranger!

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

Categories

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.