I am a little confused with your code it works fine but as soon as I modified it a little it tells me for - PrintTXTFile - arguement not optiona -
I am not sure what to do to get this to work now. because I am trying to print a bunch of text files off one at a time by pressing this print button. Can u help me?
this is the code excluding the module(which works fine)
Private Sub Command1_Click()
Dim ofolder As Folder
Dim ofso As New FileSystemObject
Dim Item As Collection
Set ofolder = ofso.GetFolder("C:documents and settingsmlanedesktop")
'MsgBox "whatever" + (ofolder.Files.Count)
'Set ofso = ofolder.Files
For Each Item In ofolder.Files
If Item.Name = "C:documents and settingsmlanedesktopnew text document.txt" Like "C:documents and settingsmlanedesktop*.txt" Then
PrintTXTFile = ("C:documents and settingsmlanedesktopnew text document.txt")
End If