Impression de fichier *.emf contenu dans plusieur sous dossiers
pyhrrus1
Messages postés7Date d'inscriptionlundi 5 avril 2004StatutMembreDernière intervention23 novembre 2005
-
23 nov. 2005 à 10:58
cs_JMO
Messages postés1854Date d'inscriptionjeudi 23 mai 2002StatutMembreDernière intervention24 juin 2018
-
23 nov. 2005 à 21:05
J'ai un dossier principal qui ontient plusieurs sous dossiers qui eux contiennent 1,2,3,...,n nombres de fichiers *.emf.
je souhaite que lorsque l'on selectionne le dossier principal et que l'on clic sur un bouton tous les fichiers contenus dans les sous dossiers s'imprime. Les noms et les nombres de sous dossiers sont variables.
Set WshShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set dossier = fso.GetFolder(path)
Set fichiers = Dossier.Files
For Each fichier in fichiers
'MsgBox "shortPath=" & fichier.ShortPath & vbCrLf & "Path=" & fichier.Path
'MsgBox "shortName=" & fichier.ShortName & vbCrLf & "Name=" & fichier.Name
If Left(fichier.name,19) = "Main courante Ifdex" Then
WshShell.Run fichier.ShortPath
WScript.Sleep(3000)
WshShell.SendKeys "^p"
WScript.Sleep(2000)
WshShell.SendKeys "{ENTER}" 'imprimer => ok
WScript.Sleep(3000)
WshShell.SendKeys "%(fq)" 'fermeture du document
WScript.Sleep(3000)
End If
If Left(fichier.name,6) = "SLIFAC" Then
WshShell.Run fichier.ShortPath
WScript.Sleep(2000)
If Left(fichier.name,22) = "SLIFAC 32 - 61 Espagne" Then
WshShell.SendKeys "^p"
WScript.Sleep(2000)
WshShell.SendKeys "{ENTER}" 'imprimer => ok
WScript.Sleep(3000)
WshShell.SendKeys "{ENTER}" 'poursuivre l'impression => ok
WScript.Sleep(3000)
WshShell.SendKeys "%(fq)" 'fermeture du document
WScript.Sleep(3000)
Else 'section pour éditer <54 EUROFACTOR> , <62 PORTUGAL>
' <67 HOLLANDE> , <68 READING>
WshShell.SendKeys "^p"
WScript.Sleep(2000)
WshShell.SendKeys "{ENTER}" 'imprimer => ok
WScript.Sleep(3000)
WshShell.SendKeys "%(fq)" 'fermeture du document
WScript.Sleep(3000)
End If
End If
Next
Set fso = Nothing