I am reading multiple PDF files with VBA using library Adobe Acrobat 10.0 Type Library. It works great except for the corrupted files. If file is corrupted it throws an error in Adobe Acrobat and VBA code is frozen until I confirm the error in Adobe. Is it possible to somehow skip the file or automatically confirm error in VBA. Or maybe turn off notifications in Acrobat. Error that appears is:
Abobe Acrobat DC could not open 'file.pdf' because it is either not a supported file type or because the file was damaged.
Set AcroApp = CreateObject("AcroExch.App")
Set AcroAVDoc = CreateObject("AcroExch.AVDoc")
If AcroAVDoc.Open("corrupted file.pdf", vbNull) <> True Then
MsgBox("There was an error")
End If
I was looking online with no luck. Also checked https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/iac_api_reference.pdf