Sub CONVERT_PDF_DOC()
Dim aApp As Acrobat.acroapp
Dim av_doc As cacroavdoc
Dim pdf_doc As acropddoc
Dim jso_obj As Object
Dim dfile As String
Dim sfile As String
Dim ext As String
Dim path, file As String
path = "C:\CUSTOMER_ORDER\"
file = Dir(path & "*.pdf")
ext = "xlsx"
Do While file <> ""
dfile = path & Replace(file, ".pdf", "." & ext, 1)
Set aApp = CreateObject("AcroExch.App")
Set av_doc = CreateObject("AcroExch.AVDoc")
If av_doc.Open(file, vbNull) = True Then -> NOT OPEN.. MESSAGE POP UP - "CAN'T FIND FILE INFORMATION"
Set pdf_doc = av_doc.GetPDDoc
Set jso_obj = pdf_doc.GetJSObject
jso_obj.SaveAs dfile, "com.adobe.acrobat." & ext
End If
av_doc.Close flase
aApp.Exit
Set aApp = Nothing
Set av_doc = Nothing
file = Dir()
Loop
End Sub
BUT IF I USE FILE : "C:\CUSTOMER_ORDER\1234.pdf" -> SPECIFIC FILE NAME ->NO PROBLEM!
HOW TO FIGURE IT OUT? FOR REPLACING MULTIPLE PDF FILES IN FOLDER
Dim aApp As Acrobat.acroapp
Dim av_doc As cacroavdoc
Dim pdf_doc As acropddoc
Dim jso_obj As Object
Dim dfile As String
Dim sfile As String
Dim ext As String
Dim path, file As String
path = "C:\CUSTOMER_ORDER\"
file = Dir(path & "*.pdf")
ext = "xlsx"
Do While file <> ""
dfile = path & Replace(file, ".pdf", "." & ext, 1)
Set aApp = CreateObject("AcroExch.App")
Set av_doc = CreateObject("AcroExch.AVDoc")
If av_doc.Open(file, vbNull) = True Then -> NOT OPEN.. MESSAGE POP UP - "CAN'T FIND FILE INFORMATION"
Set pdf_doc = av_doc.GetPDDoc
Set jso_obj = pdf_doc.GetJSObject
jso_obj.SaveAs dfile, "com.adobe.acrobat." & ext
End If
av_doc.Close flase
aApp.Exit
Set aApp = Nothing
Set av_doc = Nothing
file = Dir()
Loop
End Sub
BUT IF I USE FILE : "C:\CUSTOMER_ORDER\1234.pdf" -> SPECIFIC FILE NAME ->NO PROBLEM!
HOW TO FIGURE IT OUT? FOR REPLACING MULTIPLE PDF FILES IN FOLDER