1 2 3 4 5 6 7 8 9 10 11
| #If Mac Then
' Enregistrer le document en format PDF sous MacOS
filePDF = wsCommand.Cells(j, 2).Value & "_" & champClient1.Offset(0, 1).Value & "_" & champClient2.Offset(0, 1).Value & "_" & champSuffixeDate.Offset(0, 1).Value & ".pdf" '
Dim PDFpath As String
PDFpath = path & "/" & filePDF
ActiveDocument.SaveAs2 Filename:=PDFpath, FileFormat:=wdFormatPDF
#Else
' Enregistrer le document en format PDF sous Windows
filePDF = wsCommand.Cells(j, 2).Value & "_" & champClient1.Offset(0, 1).Value & "_" & champClient2.Offset(0, 1).Value & "_" & champSuffixeDate.Offset(0, 1).Value & ".pdf" '
WordApp.ActiveDocument.ExportAsFixedFormat OutputFileName:=path & "" & filePDF, ExportFormat:=wdExportFormatPDF
#End If |
Partager