Skip to main content
IliaD
Participant
June 15, 2017
Question

VBA: use SetPreferenceEx to change Convert From PDF settings?

  • June 15, 2017
  • 2 replies
  • 2465 views

Hi! Is it possible to use SetPreferenceEx to change Convert From PDF settings?

I am using Acrobat XI Pro from VBA to convert a large number of PDFs to Word documents. In order to do this I need to programmatically change "Convert From PDF" settings, in particular disable the OCR.

Is SetPreferenceEx the right function for that? Where can I find a list of all preferences that can be set by SetPreferenceEx?

Thanks for any help.

This topic has been closed for replies.

2 replies

IliaD
IliaDAuthor
Participant
June 15, 2017

Yes, its in SDK, I am using VBA to open a PDF file in Acrobat and then call SaveAs (via JavaScript). Here is the VBA code:

Dim objAcroApp As Object, objAcroAVDoc As Object, objAcroPDDoc As Object, objJSO As Object

'Initialize Acrobat by creating App object and setting AVDoc object

Set objAcroApp = CreateObject("AcroExch.App")

Set objAcroAVDoc = CreateObject("AcroExch.AVDoc")

'Open the PDF file

objAcroAVDoc.Open("SomeFile.pdf")

'Obtain the PDDoc object and the Java Script Object

Set objAcroPDDoc = objAcroAVDoc.GetPDDoc

Set objJSO = objAcroPDDoc.GetJSObject

'Save PDF file to the .docx format

objJSO.SaveAs("SomeFile.docx", "com.adobe.acrobat.docx")

'Close the PDF file without saving the changes.

objAcroAVDoc.Close(True)

Legend
June 15, 2017

Which API method are you using to do the conversion? Is it in the SDK?