xlhelp15
Board Regular
- Joined
- Sep 12, 2014
- Messages
- 113
- Office Version
- 365
- Platform
- Windows
- Mobile
- Web
Dear All,
Could you please help me to resolve the error message while i'm to run the code. I've got code this piece through online to convert pdf2txt.
Am i need to add any references to run this or is there any modification in that code?
Thanks in advance,
Sub test()
Dim AcroXApp As Object
Dim AcroXAVDoc As Object
Dim AcroXPDDoc As Object
Set AcroXApp = CreateObject("AcroExch.App") - Error shows as in this line as "ActiveX component can't create object
AcroXApp.Hide
Set AcroXAVDoc = CreateObject("AcroExch.AVDoc")
AcroXAVDoc.Open "C:\Users\karthikh\Desktop\check.pdf", "Acrobat"
AcroXAVDoc.BringToFront
Set AcroXPDDoc = AcroXAVDoc.GetPDDoc
Dim jsObj As Object
Set jsObj = AcroXPDDoc.GetJSObject
jsObj.SaveAs "C:\Users\karthikh\Desktop\mine.txt", "com.adobe.acrobat.plain-text"
AcroXAVDoc.Close False
AcroXApp.Hide
AcroXApp.Exit
End Sub
Could you please help me to resolve the error message while i'm to run the code. I've got code this piece through online to convert pdf2txt.
Am i need to add any references to run this or is there any modification in that code?
Thanks in advance,
Sub test()
Dim AcroXApp As Object
Dim AcroXAVDoc As Object
Dim AcroXPDDoc As Object
Set AcroXApp = CreateObject("AcroExch.App") - Error shows as in this line as "ActiveX component can't create object
AcroXApp.Hide
Set AcroXAVDoc = CreateObject("AcroExch.AVDoc")
AcroXAVDoc.Open "C:\Users\karthikh\Desktop\check.pdf", "Acrobat"
AcroXAVDoc.BringToFront
Set AcroXPDDoc = AcroXAVDoc.GetPDDoc
Dim jsObj As Object
Set jsObj = AcroXPDDoc.GetJSObject
jsObj.SaveAs "C:\Users\karthikh\Desktop\mine.txt", "com.adobe.acrobat.plain-text"
AcroXAVDoc.Close False
AcroXApp.Hide
AcroXApp.Exit
End Sub