Beginner VB

Moderators: None (Apply to moderate this forum)
Number of threads: 1233
Number of posts: 2978

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Opening files with VB 6.0 Posted by mercury2025 on 4 Apr 2002 at 1:52 AM
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!

Report
Re: Opening files with VB 6.0 Posted by KDivad Leahcim on 4 Apr 2002 at 6:03 AM
: 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!
:
:
    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




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.