1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| FilesArray = Application.GetOpenFilename("Fichiers MS Word (*.doc),*.doc,Tous fichiers (*.*),*.*", , "Sélection des fichiers", , True)
If TypeName(FilesArray) = "Boolean" Then
If FilesArray = False Then
MsgBox "Aucun fichier sélectionné.", vbExclamation + vbOKOnly, "Sélection des fichiers"
Exit Sub
End If
End If
If GetPDFPrinter = False Then
MsgBox "Veuillez (faire) installer l'imprimante Acrobat Distiller, s.v.p.", vbExclamation + vbOKOnly
Exit Sub
End If
sActivePrinter = Application.ActivePrinter
Set oFSO = CreateObject("Scripting.FileSystemObject")
For iCount = 1 To UBound(FilesArray)
sExtension = oFSO.GetExtensionName(FilesArray(iCount))
If sExtension = "doc" Then
Set oDocument = oWordApp.documents.Open(FilesArray(iCount))
oDocument.PrintOut Copies:=1, Collate:=True, ActivePrinter:=GetPDFPrinter
End If
Next |