here is my script
Option Explicit
Dim objArgs, strDir, arrFile, arrFile1, objXL, objShell, objFolder , strFile, objFolderItem, V
'Make sure two command line arguements were supplied
Set objArgs = WScript.Arguments
If objArgs.Count < 2 Then
WScript.Echo "Wrong number of arguments! You need to supply the directory and the filename!"
WScript.Quit
End If
strDir = objArgs(0) 'Get the first command-line parameter
arrFile1 = objArgs(1) 'Get the second command-line parameter
'strDir = "/path/to/directory"
arrFile = Array(arrFile1)
Set objXL = CreateObject("Excel.Application")
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.NameSpace(strDir)
For Each strFile In arrFile
Set objFolderItem = objFolder.ParseName(strFile)
For Each V in objFolderItem.Verbs
If InStr(1,V,"Print",1) Or InStr(1,V,"Imprimer",1) Then
v.DoIt: Exit For
End If
Next
Next
objXL.Quit
WScript.Quit
But I have an error message on objXL.QUIT :
Error :Call was rejected by callee
code :80010001
Source: null
Can somebody help
MAny thanks
Elisabeth