Rerence that code below. I am using this macro to print all excell files in a folder without opening each file. I keep getting a debug error on the print part of the macro. How can i fix this?
Thanks

error below
Application.PrintOut Filename:=sMyDir & sDocName, Copies:=2


[Code]
Sub PrintFolder()
Dim sMyDir As String
Dim sDocName As String
un = Environ$("UserName")
' The path to obtain the files.
sMyDir = "C:\Users\" & un & "\Documents\letters\"
sDocName = Dir(sMyDir & "*.xlsm")
While sDocName <> ""
' Print the file.
Application.PrintOut Filename:=sMyDir & sDocName, Copies:=2
' Get next file name.
sDocName = Dir()
Wend
End Sub
[Code/]