1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| Sub ConvertPDFtoTxt()
Racine = "C:\Users\XXX\Desktop\" 'ajuste le chemin
Classeur = "monPDF" ' et le le nom du fichier (sans extension)
ExtPDF = ".pdf"
ExtTxt = ".txt"
'on ouvre le pdf
Shell "C:\WINDOWS\EXPLORER.EXE /n,/e," & Racine & Classeur & ExtPDF, vbNormalFocus: Cancel = True
'on l'enregistre en txt
Application.Wait Now + TimeValue("0:00:03") 'temporisation à ajuster
SendKeys "%fx", True
Application.Wait Now + TimeValue("0:00:01")
SendKeys Racine & Classeur & ExtTxt & "~", True
Application.Wait Now + TimeValue("0:00:01")
'on ferme reader
SendKeys "%{F4}", True
End Sub |
Partager