Bonjour,
J'ai tenté de reproduire les instructions d'une video en vu de convertir via une macro un document .pdf en .xlsx.
Chez lui,... ça marche lol 🥹
les seules différence c'est que moi j'utilise Foxit et l'adresse du fichier...(forcément)
Merci pour votre aide!!!
et bon dimanche.
Option Explicit
Sub convert_pdf_doc()
Dim foxitApp As Object
Dim av_doc As Object
Dim pdf_doc As Object
Dim jso_obj As Object
Dim sfile As String
Dim dfile As String
Dim ext As String
ext = "xlsx"
sfile = "C:\Users\FAMILLE\Documents\devis dentaire.pdf"
dfile = Replace(sfile, ".pdf", "." & ext, 1)
Set foxitApp = CreateObject("FoxitPDFReader.Application")
Set av_doc = foxitApp.GetActiveDoc()
If Not av_doc Is Nothing Then
Set pdf_doc = av_doc.GetPDDoc()
Set jso_obj = pdf_doc.GetJSObject
jso_obj.SaveAs dfile, "com.foxitpdf.reader." & ext
av_doc.Close
End If
Set foxitApp = Nothing
Set av_doc = Nothing
Set pdf_doc = Nothing
Set jso_obj = Nothing
End Sub
J'ai tenté de reproduire les instructions d'une video en vu de convertir via une macro un document .pdf en .xlsx.
Chez lui,... ça marche lol 🥹
les seules différence c'est que moi j'utilise Foxit et l'adresse du fichier...(forcément)
Merci pour votre aide!!!
et bon dimanche.
Option Explicit
Sub convert_pdf_doc()
Dim foxitApp As Object
Dim av_doc As Object
Dim pdf_doc As Object
Dim jso_obj As Object
Dim sfile As String
Dim dfile As String
Dim ext As String
ext = "xlsx"
sfile = "C:\Users\FAMILLE\Documents\devis dentaire.pdf"
dfile = Replace(sfile, ".pdf", "." & ext, 1)
Set foxitApp = CreateObject("FoxitPDFReader.Application")
Set av_doc = foxitApp.GetActiveDoc()
If Not av_doc Is Nothing Then
Set pdf_doc = av_doc.GetPDDoc()
Set jso_obj = pdf_doc.GetJSObject
jso_obj.SaveAs dfile, "com.foxitpdf.reader." & ext
av_doc.Close
End If
Set foxitApp = Nothing
Set av_doc = Nothing
Set pdf_doc = Nothing
Set jso_obj = Nothing
End Sub