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
:
: 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]