J'ai ouvert un fichier PDF avec VBA excel, je voudrais le renommer et l'enregistrer sous un répertoire x...... et nom y avec une VBA excel.
Pouvez vous m'aider

En vous remerciant d'avance.

PS je ne suis vraiment pas doué en VBA.


Voici mon code

Merci

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
Option Explicit
 
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_SHOWNORMAL = 1
 
Sub SelectionFichier()
Dim Fichier As Variant
    ChDir ThisWorkbook.Path & "\"
    Fichier = Application.GetOpenFilename("Fichier PDF (*.pdf), *.pdf")
    If Fichier <> False Then OuvrirPDF (Fichier)
 
End Sub
 
Private Sub OuvrirPDF(sFichier As String)
Dim hwnd As Long
ShellExecute hwnd, "Open", sFichier, 0&, 0&, SW_SHOWNORMAL
 
 
'ici il me faudrait le code qui vas bien save as !!!!!!!!!!!!!!
 
 
 
KillAcrobat
 
End Sub
 
Private Sub KillAcrobat()
Dim Rep As Variant
    Rep = Shell("Taskkill /im Acrobat.exe /f", 0)
End Sub