1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| Sub SelecFichier()
Dim oPDDoc1 As Variant
ChDir ThisWorkbook.Path & "\"
oPDDoc1 = Application.GetOpenFilename("Fichiers PDF (*.pdf), *.pdf", Title:="Sélection PDF")
If oPDDoc1 = False Then Exit Sub
Dim oPDDoc2 As Variant
ChDir ThisWorkbook.Path & "\"
oPDDoc2 = Application.GetOpenFilename("Fichiers PDF (*.pdf), *.pdf", Title:="Sélection PDF")
If oPDDoc2 = False Then Exit Sub
DoEvents
Fusion_PDF4s
End Sub
Sub Fusion_PDF4s()
Dim oPDDoc1 As Object
Dim oPDDoc2 As Object
Dim Num As Long
Set oPDDoc1 = CreateObject("AcroExch.PDDoc")
Set oPDDoc2 = CreateObject("AcroExch.PDDoc")
oPDDoc1.Open (ThisWorkbook.Path & "\" & "Test.pdf")
oPDDoc2.Open (ThisWorkbook.Path & "\" & "SD.pdf")
' Paramètres :
' 1 Page du document en cours après laquelle l'insertion sera faite. La 1ere page est 0.
' 2 Document contenant les pages à insérer.
' 3 La 1ere page à être insérée dans le document en cours à partir du Document contenant les pages à insérer.
' 4 Le nombre de pages à insérer.
' 5 Si nombre > 0 les bookmarks sont copiés, si 0 ils ne le sont pas.
oPDDoc1.InsertPages 7, oPDDoc2, 0, 1, 0
oPDDoc1.Save 1, ThisWorkbook.Path & "\" & "Fusion1123.pdf"
oPDDoc2.Close
oPDDoc1.Close
Set oPDDoc2 = Nothing
Set oPDDoc1 = Nothing
End Sub |
Partager